-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (89 loc) · 3.34 KB
/
main.yml
File metadata and controls
94 lines (89 loc) · 3.34 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: CI
on:
push:
branches: [ main ]
jobs:
Check-MDN-Changes:
runs-on: ubuntu-latest
outputs:
mdn_changed: ${{ steps.check.outputs.mdn_changed }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Check for MDN-related file changes
id: check
run: |
# Get list of changed files in this push
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD)
echo "Changed files:"
echo "$CHANGED_FILES"
# Check if any MDN-related files were changed
if echo "$CHANGED_FILES" | grep -qE "(mdn|MDN)"; then
echo "mdn_changed=true" >> $GITHUB_OUTPUT
echo "MDN-related files were changed"
else
echo "mdn_changed=false" >> $GITHUB_OUTPUT
echo "No MDN-related files were changed"
fi
Test:
needs: Check-MDN-Changes
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.13"]
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install R and dependencies (Python 3.13 only)
if: matrix.python-version == '3.13'
run: |
sudo apt-get update
sudo apt-get install -y r-base r-base-dev libtirpc-dev
- name: Install R packages (Python 3.13 only)
if: matrix.python-version == '3.13'
run: |
sudo Rscript -e 'install.packages("StatMatch", repos="https://cloud.r-project.org")'
sudo Rscript -e 'install.packages("clue", repos="https://cloud.r-project.org")'
- name: Install full dependencies without MDN (Python 3.13)
if: matrix.python-version == '3.13' && needs.Check-MDN-Changes.outputs.mdn_changed != 'true'
run: |
uv pip install -e ".[dev,docs,matching,images]" --system
- name: Install full dependencies with MDN (Python 3.13)
if: matrix.python-version == '3.13' && needs.Check-MDN-Changes.outputs.mdn_changed == 'true'
run: |
uv pip install -e ".[dev,docs,matching,mdn,images]" --system
- name: Install minimal dependencies (Python 3.12)
if: matrix.python-version == '3.12'
run: |
uv pip install -e ".[dev]" --system
- name: Run full tests with coverage (Python 3.13)
if: matrix.python-version == '3.13'
run: make test
- name: Run smoke test only (Python 3.12)
if: matrix.python-version == '3.12'
run: |
python -m pytest tests/test_smoke_qrf.py -v
python -m pytest tests/test_basic.py -v
- name: Run pipeline example
if: matrix.python-version == '3.13'
run: |
python examples/pipeline.py
- name: Upload microimputation results
if: always() && matrix.python-version == '3.13'
uses: actions/upload-artifact@v4
with:
name: microimputation-results-${{ github.sha }}
path: microimputation-dashboard/public/microimputation_results.csv
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
fail_ci_if_error: false
verbose: true