-
Notifications
You must be signed in to change notification settings - Fork 16
107 lines (95 loc) · 3.26 KB
/
ci.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: bluemira_ci
on:
pull_request:
push:
branches:
- develop
- main
jobs:
linter:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Check Code Quality
shell: bash -l {0}
run: |
pip install pre-commit
pre-commit run --all-files
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
uses: ./.github/workflows/actions/build
with:
os: ubuntu-latest
python-version: "3.10"
bm-private-data-key: ${{ secrets.BLUEMIRA_PRIVATE_DATA_DEPLOY_KEY }}
- name: Test Documentation code snippets
shell: bash -l {0}
run: pytest bluemira documentation eudemo/eudemo
- name: Build Documentation bluemira
shell: bash -l {0}
run: |
sphinx-build -j auto -W documentation/source documentation/build
test:
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10", "3.11"]
with-process: ["v3.1.0", "process_disabled"]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
uses: ./.github/workflows/actions/build
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
bm-private-data-key: ${{ secrets.BLUEMIRA_PRIVATE_DATA_DEPLOY_KEY }}
with-artifact: ${{ matrix.with-process == 'process_disabled' && 'false' || 'true' }}
- name: Install PROCESS
if: ${{ matrix.with-process != 'process_disabled' }}
uses: ./.github/workflows/actions/process
with:
version: ${{ matrix.with-process }}
- name: Run pytest bluemira
shell: bash -l {0}
env:
# Flag to run longrun tests when merging dependency updates
# https://github.com/actions/runner/issues/409#issuecomment-752775072
PYTEST_LONGRUN: ${{ github.event.pull_request.head.ref == 'develop_dependencies' && '--longrun' || '' }}
PYTEST_PRIVATE: ${{ !github.event.pull_request.head.repo.fork && '--private' || '' }}
run: |
pytest --cov=bluemira \
--cov-report html:htmlcov_bluemira \
--cov-report xml \
--json-report \
--json-report-file=test-report.json \
--json-report-indent=2 \
--reactor \
${PYTEST_PRIVATE} \
${PYTEST_LONGRUN} \
tests eudemo/eudemo_tests
- name: Upload test report
uses: actions/upload-artifact@v4
if: ${{ matrix.with-process != 'process_disabled' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: test-report-json_${{ matrix.python-version }}_${{ matrix.os }}
path: test-report.json
overwrite: true
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: ${{ github.ref_name == 'develop' || github.ref_name == 'main' }}