Skip to content

update for OM2

update for OM2 #323

Workflow file for this run

name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
inputs:
test_suite:
description: 'Which test suite to run'
required: true
default: 'unit'
type: choice
options:
- unit
- integration
- all
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.39.5
- name: Run pre-commit
run: pixi run -e dev pre-commit run --all-files
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/[email protected]
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.39.5
- name: Create default config file
run: |
mkdir -p ~/.moppy
cat <<EOF > ~/.moppy/user.yml
creator_name: "CI Bot"
organisation: "ACCESS-NRI"
creator_email: "[email protected]"
creator_url: "https://example.com"
EOF
- name: List installed packages
run: pixi list -e test
- name: Run smoke and unit tests (automatic)
if: github.event_name != 'workflow_dispatch'
run: pixi run -e test pytest tests/test_smoke.py tests/unit --cov=access_moppy --cov-report=xml
- name: Run unit tests only (manual)
if: github.event_name == 'workflow_dispatch' && github.event.inputs.test_suite == 'unit'
run: pixi run -e test pytest tests/test_smoke.py tests/unit --cov=access_moppy --cov-report=xml
- name: Run integration tests only (manual)
if: github.event_name == 'workflow_dispatch' && github.event.inputs.test_suite == 'integration'
run: pixi run -e test pytest tests/integration --cov=access_moppy --cov-report=xml
- name: Run all tests (manual)
if: github.event_name == 'workflow_dispatch' && github.event.inputs.test_suite == 'all'
run: pixi run -e test pytest tests --cov=access_moppy --cov-report=xml
- name: Upload code coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.codecov_token }}
files: ./coverage.xml