Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions .github/workflows/test-models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
branches:
- master
pull_request:
branches:
- master
branches: ["*"]
schedule:
- cron: "0 5 * * *"

Expand All @@ -24,7 +23,7 @@ jobs:
matrix:
version:
- master
# - latest # Activate when v0.14.0 is released
# - latest

defaults:
run:
Expand All @@ -43,6 +42,18 @@ jobs:
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latest_tag

- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.6
with:
pixi-version: v0.68.1
cache: true
# Do not cache in branches
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}

- name: Setup cache keys
run: |
echo "WEEK=$(date +'%Y%U')" >> $GITHUB_ENV # data and cutouts

# Only run check if package is not pinned
- name: Check if inhouse package is pinned
run: |
Expand Down Expand Up @@ -87,17 +98,20 @@ jobs:
- name: Install package from ref
if: env.pinned == 'false'
run: |
python -m pip install git+https://github.com/${{ github.repository }}@${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
pixi remove pypsa
pixi remove linopy
pixi add --pypi --git https://github.com/${{ github.repository }}.git ${{ github.event.repository.name }} --rev ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
pixi add --pypi pypsa

- name: Run snakemake test workflows
if: env.pinned == 'false'
run: |
make test
pixi run integration-tests

- name: Run unit tests
if: env.pinned == 'false'
run: |
make unit-test
pixi run unit-tests

- name: Upload artifacts
if: env.pinned == 'false'
Expand All @@ -109,3 +123,7 @@ jobs:
.snakemake/log
results
retention-days: 3

- name: Show remaining disk space
if: always()
run: df -h
Loading