Skip to content

Commit

Permalink
Update python-app.yml
Browse files Browse the repository at this point in the history
Use latest GitHub actions:
- https://github.com/marketplace/actions/setup-python
- https://github.com/marketplace/actions/setup-graphviz

and greatly simplify the installation on Windows.
  • Loading branch information
VaeterchenFrost committed Dec 17, 2024
1 parent e2932b0 commit 5ba19a4
Showing 1 changed file with 3 additions and 30 deletions.
33 changes: 3 additions & 30 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand All @@ -85,41 +85,14 @@ jobs:
python -m pip install --upgrade pip
pip install wheel
- name: Install graphviz for visualization test
if: ${{ runner.os == 'macOS' }}
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v2
with:
macos-skip-brew-update: 'true' # default false

- name: Setup Conda
if: ${{ runner.os == 'Windows' }}
uses: s-weigand/setup-conda@v1
with:
# Whether to activate the conda base env (Default: 'true')
activate-conda: true
# Python version which should be installed with conda (default: 'Default')
python-version: 3.8

- name: Install graphviz via conda
if: ${{ runner.os == 'Windows' }}
run: |
conda install -c anaconda graphviz
- name: add graphviz PATH
if: ${{ runner.os == 'Windows' }}
run: |
# should give base conda python
$python=Get-Command python
$pypath=Split-Path $python.Source -Parent
# Add to PATH, we know pypath is on it
$dot=[IO.Path]::Combine($pypath, 'Library', 'bin', 'graphviz')
echo $dot | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
shell: powershell

- name: register plugins for graphviz
if: ${{ runner.os == 'Windows' }}
run: |
# execute dot
dot -V
dot -c
Expand Down

0 comments on commit 5ba19a4

Please sign in to comment.