forked from instadeepai/mlip
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 2.05 KB
/
tests_and_linters.yaml
File metadata and controls
78 lines (65 loc) · 2.05 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
name: Tests and Linters 🧪
on:
release:
types: [published]
jobs:
linters:
runs-on: ubuntu-latest
container:
image: python:3.12-slim-bullseye
steps:
- name: setup
run: |
apt-get update && apt-get install -y \
coreutils \
git
git config --system --add safe.directory $GITHUB_WORKSPACE
- name: checkout code 📦
uses: actions/checkout@v4
- name: install uv
uses: astral-sh/setup-uv@v6
- name: setup env
run: uv sync --only-dev
- name: run linters 🖌️
run: |
git init
uv run --no-sync pre-commit run --all-files --verbose
tests:
runs-on: ubuntu-latest
container:
image: python:3.12-slim-bullseye
steps:
- name: checkout code 📂
uses: actions/checkout@v4
- name: setup
run: |
apt-get update && apt-get install -y \
coreutils \
git
- name: install uv
uses: astral-sh/setup-uv@v6
- name: setup env
run: uv sync
- name: run tests 🧪
run: |
uv run --no-sync pytest --ignore tests/experiments --verbose \
--cov-report xml:coverage.xml \
--cov-report term-missing \
--junitxml=pytest.xml \
--cov=mlip tests/
- name: pytest coverage comment
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-xml-coverage-path: ./coverage.xml
junitxml-path: ./pytest.xml
- name: Create the Badge
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.BOT_ACCESS_TOKEN }}
gistID: b6e4bf384215e60775699a83c3c00aef
filename: pytest-coverage-comment.json
label: Test Coverage
message: ${{ steps.coverageComment.outputs.coverage }}
color: ${{ steps.coverageComment.outputs.color }}
namedLogo: python