Feature: Interactive balance maps #2807
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test workflows | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: "0 5 * * 1-6" | |
| - cron: "0 5 * * 0" | |
| workflow_dispatch: | |
| # Cancel any in-progress runs when a new run is triggered | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| run-tests: | |
| name: OS | |
| runs-on: ${{ matrix.os }}-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Run windows only on scheduled runs on Sundays, otherwise ignore | |
| os: ${{ github.event.schedule == '0 5 * * 0' && fromJson('["ubuntu", "macos", "windows"]') || fromJson('["ubuntu", "macos"]') }} | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| src: | |
| - 'scripts/**' | |
| - 'rules/**' | |
| - 'data/**' | |
| - 'Snakefile' | |
| - 'config/**' | |
| - 'test/**' | |
| - 'pixi.toml' | |
| - 'pixi.lock' | |
| - '.github/workflows/test.yaml' | |
| - name: Free up disk space | |
| run: | | |
| echo "Initial disk space" | |
| df -h | |
| echo "Free up disk space" | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL | |
| sudo docker image prune --all --force | |
| sudo docker builder prune -a --force | |
| echo "Final disk space" | |
| df -h | |
| - name: Skip - no source changes | |
| if: steps.filter.outputs.src != 'true' && github.event_name != 'schedule' | |
| run: echo "Skipping tests because no source code changes detected" | |
| - name: Setup Pixi | |
| if: steps.filter.outputs.src == 'true' || github.event_name == 'schedule' | |
| uses: prefix-dev/[email protected] | |
| with: | |
| pixi-version: v0.59.0 | |
| cache: true | |
| # Do not cache in branches | |
| cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | |
| - name: Setup cache keys | |
| if: steps.filter.outputs.src == 'true' || github.event_name == 'schedule' | |
| run: | | |
| echo "WEEK=$(date +'%Y%U')" >> $GITHUB_ENV # data and cutouts | |
| - uses: actions/cache@v5 | |
| if: steps.filter.outputs.src == 'true' || github.event_name == 'schedule' | |
| with: | |
| path: | | |
| data | |
| cutouts | |
| key: data-cutouts-${{ env.WEEK }} | |
| - name: Run pylint check on scripts | |
| if: steps.filter.outputs.src == 'true' || github.event_name == 'schedule' | |
| # check for undefined variables to reuse functions across scripts | |
| run: | | |
| pixi run pylint --disable=all --enable=E0601,E0606 --output-format=parseable scripts/add_* scripts/prepare_* scripts/solve_* | |
| - name: Run snakemake test workflows | |
| if: steps.filter.outputs.src == 'true' || github.event_name == 'schedule' | |
| env: | |
| SNAKEMAKE_STORAGE_CACHED_HTTP_CACHE: "" | |
| SNAKEMAKE_STORAGE_CACHED_HTTP_SKIP_REMOTE_CHECKS: "1" | |
| run: | | |
| pixi run integration-tests | |
| - name: Run unit tests | |
| if: steps.filter.outputs.src == 'true' || github.event_name == 'schedule' | |
| run: | | |
| pixi run unit-tests | |
| - name: Upload artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: results-${{ matrix.os }} | |
| path: | | |
| logs | |
| .snakemake/log | |
| results | |
| retention-days: 3 | |
| - name: Show remaining disk space | |
| if: always() | |
| run: df -h |