Weather morpher #313
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: CI | |
# Runs unit and integration tests | |
# Only triggered on source code and dependency updates | |
on: | |
pull_request: | |
types: [opened, synchronize, ready_for_review] | |
branches: [master, release-**] | |
# Ignore changes in the interfaces directory since they do not have tests | |
# TODO: Add tests for interfaces module | |
paths: ['cea/**', 'pyproject.toml', 'pixi.lock', '!cea/interfaces/**'] | |
push: | |
branches: [master] | |
paths: ['cea/**', 'pyproject.toml', 'pixi.lock', '!cea/interfaces/**'] | |
concurrency: | |
# Use head_ref for PRs, fall back to ref for pushes | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
# Only cancel in-progress jobs for PRs, not for pushes to master | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
permissions: | |
contents: read | |
jobs: | |
tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# wntr does not support linux ARM (no EPANET ARM binaries) | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup pixi | |
uses: prefix-dev/[email protected] | |
with: | |
cache: true | |
- name: Install CEA | |
run: pixi run pip install . | |
- name: Run unit tests | |
run: pixi run cea test --type unittest | |
- name: Run integration tests | |
if: github.event.pull_request.draft == false | |
run: pixi run cea test --type integration |