-
Notifications
You must be signed in to change notification settings - Fork 2
113 lines (109 loc) · 3.94 KB
/
pr_code_changes.yaml
File metadata and controls
113 lines (109 loc) · 3.94 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Pull request
on:
pull_request:
branches: [ main ]
jobs:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install relevant dependencies
run: |
uv pip install black isort linecheck --system
- name: Check code formatting
run: make check-format
Check-MDN-Changes:
runs-on: ubuntu-latest
outputs:
mdn_changed: ${{ steps.check.outputs.mdn_changed }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check for MDN-related file changes
id: check
run: |
# Get list of changed files in this PR
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...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
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: ["3.12", "3.13"]
fail-fast: false
runs-on: ${{ matrix.os }}
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 slim version
run: |
uv pip install -e "." --system
- 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 test 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,matching]" --system
- name: Install full test 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,matching,mdn]" --system
- name: Install minimal test 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