-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (65 loc) · 2.24 KB
/
Copy pathci.yml
File metadata and controls
77 lines (65 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: CI
on:
pull_request:
branches: [main]
push:
branches-ignore: [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/checkout@v4.2.2
- uses: prefix-dev/setup-pixi@v0.8.14
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/checkout@v4.2.2
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.8.14
with:
pixi-version: v0.39.5
- name: Create default config file
run: |
mkdir -p ~/.mopper
cat <<EOF > ~/.mopper/user.yml
creator_name: "CI Bot"
organisation: "ACCESS-NRI"
creator_email: "ci@example.com"
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_mopper --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_mopper --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_mopper --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_mopper --cov-report=xml
- name: Upload code coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.codecov_token }}
files: ./coverage.xml