-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (51 loc) · 1.7 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
name: Tests
on:
push:
branches: [main]
paths-ignore: ["**/*.md", docs/**]
pull_request:
branches: [main]
paths-ignore: ["**/*.md", docs/**]
workflow_dispatch:
workflow_call:
permissions:
contents: read
jobs:
test:
# prevent this action from running on forks
if: github.repository == 'ab5424/agility'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
version:
- { python: "3.9", resolution: lowest-direct, extra: "tests,ovito,ase,pymatgen" }
- { python: "3.12", resolution: highest, extra: "tests,ovito,ase,pymatgen" }
# Add macOS without optional dependencies, running only on python 3.10
include:
- os: macos-latest
version: { python: "3.10", resolution: highest, extra: "tests,strict" }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.version.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version.python }}
cache: pip
- name: Install dependencies
run: |
pip install uv
uv pip install -e .[${{ matrix.version.extra }}] --resolution=${{ matrix.version.resolution }} --system
# Fix ImportError: libEGL.so.1: ...
- name: Install libegl1-mesa-dev on Linux
if: runner.os == 'Linux'
run: |
sudo apt update && sudo apt install -y libegl1-mesa-dev
- name: pytest
run: |
pytest --cov=agility --cov-report=xml tests
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}