-
Notifications
You must be signed in to change notification settings - Fork 19
66 lines (55 loc) · 1.86 KB
/
test.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
name: Test
on:
push:
branches:
- master
pull_request:
# This will run the action for pull requests from any branch
branches:
- '*'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12'] # Add more Python versions if needed, like '3.8', '3.9', '3.10', etc.
steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v4
# Step 2: Set up Python environment
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Step 3: Install Poetry
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
poetry self add "poetry-dynamic-versioning[plugin]"
# Step 4: Install System Dependencies
- name: Install Graphviz
run: sudo apt-get install -y graphviz
# Step 5: Install Rust
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
# Step 6: Install Python Dependencies using Poetry
- name: Install dependencies
run: |
poetry install --with dev
# Step 7: Install the Rust package
- name: Build and Install the Package
run: poetry run maturin develop
# Step 8: Run Tests and Generate Coverage Report
- name: Run tests and coverage
run: |
poetry run pytest ./tests/ --cov=./src/pyhgf/ --cov-report=xml
# Step 9: Upload Coverage Report to Codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # Make sure to set this token in repository secrets