Skip to content

Adding instructions for anaconda install #5345

Adding instructions for anaconda install

Adding instructions for anaconda install #5345

Workflow file for this run

name: Full Build
on:
push:
branches:
- main
paths-ignore:
- '*.md'
pull_request:
branches:
- main
release:
types: [published]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
python_version: '3.12'
mainline_build: ${{ github.ref == 'refs/heads/main' || github.event.label.name == 'translation' || github.event_name == 'release' }}
PYTHONWARNDEFAULTENCODING: 'true'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Harden Runner
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
disable-sudo: true
disable-file-monitoring: true
egress-policy: block
allowed-endpoints: >
files.pythonhosted.org:443
github.com:443
pypi.org:443
objects.githubusercontent.com
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.python_version }}
- name: Lint with Pre-commit
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
- name: Check REUSE compliance
run: pip install --constraint=.github/constraints.txt reuse && python -m reuse lint
- name: Check translations
run: pip install --constraint=.github/constraints.txt babel && python po/check-babel.py
- name: Check Poetry lock file integrity
run: |
python${{ env.python_version }} -m pip install --constraint=.github/constraints.txt poetry
poetry config virtualenvs.in-project true
poetry check
linux-wheel:
name: Linux (Wheel) with Python ${{ matrix.python_version }}
needs: lint
runs-on: ubuntu-22.04
container: fedora:39
timeout-minutes: 30
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
matrix:
python_version: ['3.11', '3.12']
outputs:
targz: gaphor-${{ steps.install.outputs.version }}.tar.gz
wheel: gaphor-${{ steps.install.outputs.version }}-py3-none-any.whl
version: ${{ steps.install.outputs.version }}
steps:
- name: Install Linux Dependencies
run: >
dnf install -y gcc git graphviz pkg-config python-launcher upx
mutter dbus-x11 gtk4 gobject-introspection-devel
cairo-gobject-devel gtksourceview5-devel libadwaita-devel cairo-devel
python${{ matrix.python_version }}-devel
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set ownership of checkout directory
run: chown -R $(id -u):$(id -g) $PWD
- name: Use Python Dependency Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-python${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}-39
- name: Install Dependencies
id: install
uses: ./.github/actions/install
with:
python-command: python${{ matrix.python_version }}
- name: Run Gaphor Tests
env:
XDG_RUNTIME_DIR: /tmp
run: |
eval $(dbus-launch --auto-syntax)
mutter --wayland --no-x11 --sm-disable --headless -- poetry run pytest --cov
- name: Upload Code Coverage to Code Climate
if: ${{ matrix.python_version == env.python_version }}
uses: paambaati/codeclimate-action@b74bb25d2074a4bc16bd06fffc1b299c07b1f886 # v6.0.0
env:
CC_TEST_REPORTER_ID: 05f6288b94a87daa172d3e96a33ec331a4374be7d01eb9a42b3b21c4c550a8ff
with:
coverageCommand: poetry run coverage xml --omit="/tmp/*"
- name: Create Source Dist and Wheel
if: ${{ matrix.python_version == env.python_version }}
run: poetry build
- name: Upload gaphor-${{ steps.install.outputs.version }}.tar.gz
if: ${{ matrix.python_version == env.python_version }}
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: gaphor-${{ steps.install.outputs.version }}.tar.gz
path: dist/gaphor-${{ steps.install.outputs.version }}.tar.gz
- name: Upload gaphor-${{ steps.install.outputs.version }}-py3-none-any.whl
if: ${{ matrix.python_version == env.python_version }}
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: gaphor-${{ steps.install.outputs.version }}-py3-none-any.whl
path: dist/gaphor-${{ steps.install.outputs.version }}-py3-none-any.whl
linux-flatpak-devel:
name: Linux (Devel Flatpak)
needs: lint
runs-on: ubuntu-22.04
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-45
options: --privileged
steps:
- name: Harden Runner
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Use Python Dependency Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-22.04
- uses: flatpak/flatpak-github-actions/flatpak-builder@df610e76bc0eabff41ffaa7953f6d03123e9e26a # v6.3
with:
bundle: gaphor.flatpak
manifest-path: org.gaphor.Gaphor.json
run-tests: true
cache-key: flatpak-builder-${{ github.sha }}
macos:
name: macOS
needs: lint
runs-on: macos-12
permissions:
contents: write
timeout-minutes: 45
if: "!contains(github.event.head_commit.message, 'skip ci')"
outputs:
artifact: ${{ steps.create.outputs.artifact }}
env:
LDFLAGS: -L/usr/local/opt/python@${python_version}/lib
PKG_CONFIG_PATH: /usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/python@${python_version}/lib/pkgconfig:${PKG_CONFIG_PATH:-}
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Workaround for errors while upgrading Python@3.12
run: sudo rm -f /usr/local/bin/2to3* /usr/local/bin/idle3* /usr/local/bin/pip3* /usr/local/bin/pydoc3* /usr/local/bin/python3* /usr/local/bin/wheel3*
- name: Install macOS Dependencies
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: >
brew update && brew install gtksourceview5 libadwaita
adwaita-icon-theme gobject-introspection graphviz create-dmg upx
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.python_version }}
cache: pip
- name: Install Dependencies
id: install
uses: ./.github/actions/install
with:
python-command: python${{ env.python_version }}
- name: Run Gaphor Self-Test
run: poetry run gaphor self-test || poetry run gaphor self-test
- name: Run Gaphor Tests
run: poetry run pytest --cov
- name: Create macOS Application
id: create
uses: ./.github/actions/macos_dmg
with:
sign_app: ${{ env.mainline_build }}
version: ${{ steps.install.outputs.version }}
base64_encoded_p12: ${{ secrets.BASE64_ENCODED_P12 }}
certpassword_p12: ${{ secrets.CERTPASSWORD_P12 }}
notary_username: ${{ secrets.APPLE_NOTARY_USER }}
notary_password: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
notary_team_id: ${{ secrets.APPLE_TEAM_ID }}
check-macos-app:
name: Check macOS App
needs: macos
runs-on: macos-12
timeout-minutes: 10
steps:
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
id: download
with:
name: ${{ needs.macos.outputs.artifact }}
path: .
- name: Perform self-test (dmg)
run: |
hdiutil attach ${{ needs.macos.outputs.artifact }}
cd /Volumes/Gaphor*
# Retry if first test fails
Gaphor.app/Contents/MacOS/gaphor self-test || Gaphor.app/Contents/MacOS/gaphor self-test
windows:
name: Windows
needs: lint
runs-on: windows-latest
env:
INCLUDE: C:\gtk\include;C:\gtk\include\cairo;C:\gtk\include\glib-2.0;C:\gtk\include\gobject-introspection-1.0;C:\gtk\lib\glib-2.0\include;
LIB: C:\gtk\lib
gvsbuild_version: 2024.5.0
permissions:
contents: write
timeout-minutes: 45
outputs:
installer: gaphor-${{ steps.install.outputs.version }}-installer.exe
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: GTK binaries get from cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: cache
with:
path: C:\gtk\**
key: ${{ runner.os }}-gvsbuild-${{ env.gvsbuild_version }}
- name: Download Gvsbuild
if: steps.cache.outputs.cache-hit != 'true'
env:
GH_TOKEN: ${{ github.token }}
HASH: c5cd0079f47124190d9c66d3661da018eccc1dfc3dd31b5c01531df7f88006e5
run: |
gh release download --repo wingtk/gvsbuild ${{ env.gvsbuild_version }} -p 'GTK4_Gvsbuild_${{ env.gvsbuild_version }}_x64.zip'
(Get-FileHash GTK4_Gvsbuild_${{ env.gvsbuild_version }}_x64.zip).Hash -eq $HASH
7z x GTK4_Gvsbuild_${{ env.gvsbuild_version }}_x64.zip -oC:\gtk -y
- name: Set up env
run: |
Write-Output "PKG_CONFIG=C:\gtk\bin\pkgconf.exe" >> $env:GITHUB_ENV
Write-Output "XDG_DATA_HOME=$HOME\.local\share" >> $env:GITHUB_ENV
Write-Output "C:\gtk\bin" >> $env:GITHUB_PATH
choco install graphviz -y
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.python_version }}
cache: pip
- name: Install Dependencies
id: install
uses: ./.github/actions/install
with:
python-command: py -${{ env.python_version }}
- name: Run Gaphor Tests
run: poetry run pytest --cov
- name: Create Windows Executables
uses: ./.github/actions/windows_executables
with:
mainline_build: ${{ env.mainline_build }}
version: ${{ steps.install.outputs.version }}
cert_password: ${{ secrets.CERTPASSWORD }}
base64_encoded_pfx: ${{ secrets.BASE64_ENCODED_PFX }}
check-windows-installer:
name: Check Windows Installer
needs: windows
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: ${{ needs.windows.outputs.installer }}
path: .
- name: Install Gaphor
timeout-minutes: 5
run: start "" /WAIT "${{ needs.windows.outputs.installer }}" /S
shell: cmd
- name: Perform self-test
timeout-minutes: 5
run: start "" /WAIT "C:\Program Files\Gaphor\gaphor.exe" self-test
shell: cmd
- name: Test output
if: always()
run: type gaphor-self-test.txt
shell: cmd
scan-for-viruses:
name: Virus Check
needs: windows
runs-on: windows-latest
continue-on-error: true
timeout-minutes: 15
steps:
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: ${{ needs.windows.outputs.installer }}
path: .
- name: VirusTotal Scan
uses: crazy-max/ghaction-virustotal@v4
if: env.mainline_build == 'true'
with:
vt_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }}
request_rate: 4
update_release_body: true
files: |
${{ needs.windows.outputs.installer }}
publish-to-pypi:
name: Publish to PyPI (release only)
needs: [ linux-wheel, linux-flatpak-devel, check-macos-app, check-windows-installer ]
runs-on: ubuntu-22.04
permissions:
id-token: write
if: github.event_name == 'release'
outputs:
version: ${{ needs.linux-wheel.outputs.version }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: ${{ needs.linux-wheel.outputs.targz }}
path: dist
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: ${{ needs.linux-wheel.outputs.wheel }}
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # release/v1
trigger-website-version-update:
name: Trigger version update on gaphor/gaphor.github.io
needs: [ publish-to-pypi ]
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
with:
token: ${{ secrets.WEBSITE_DISPATCH_TOKEN }} # Expires 2024-07-08
repository: gaphor/gaphor.github.io
event-type: version-update
client-payload: '{ "version": "${{ needs.publish-to-pypi.outputs.version }}" }'
trigger-flatpak-version-update:
name: Trigger version update on flathub/org.gaphor.Gaphor
needs: [ publish-to-pypi ]
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit
- name: Wait for PyPI to sync after version update
run: sleep 30s
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
with:
token: ${{ secrets.FLATHUB_DISPATCH_TOKEN }} # Expires 2024-07-08
repository: flathub/org.gaphor.Gaphor
event-type: version-update
client-payload: '{ "version": "${{ needs.publish-to-pypi.outputs.version }}" }'