Skip to content

Commit 4705224

Browse files
committed
Add CI workflow
1 parent 918fc35 commit 4705224

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: ci
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
tests:
8+
runs-on: ubuntu-latest
9+
timeout-minutes: 60
10+
strategy:
11+
matrix:
12+
python-version: ["3.10","3.11","3.12"]
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v6
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install all dependencies
23+
run: uv sync --all-extras
24+
25+
- name: Run test suite
26+
env:
27+
# show timings of tests
28+
PYTEST_ADDOPTS: "--durations=0"
29+
run: uv run pytest --cov mlip_testing --cov-append .
30+
31+
- name: Report coverage to Coveralls
32+
uses: coverallsapp/github-action@v2
33+
with:
34+
parallel: true
35+
flag-name: run-${{ matrix.python-version }}
36+
file: coverage.xml
37+
base-path: mlip_testing
38+
39+
coverage:
40+
needs: tests
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Close parallel build
44+
uses: coverallsapp/github-action@v2
45+
with:
46+
parallel-finished: true
47+
48+
pre-commit:
49+
runs-on: ubuntu-latest
50+
timeout-minutes: 15
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- name: Install uv
55+
uses: astral-sh/setup-uv@v6
56+
with:
57+
python-version: "3.12"
58+
59+
- name: Install dependencies
60+
run: uv sync
61+
62+
- name: Run pre-commit
63+
run: |
64+
uv run pre-commit install
65+
uv run pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )

0 commit comments

Comments
 (0)