-
Notifications
You must be signed in to change notification settings - Fork 7
60 lines (56 loc) · 2.03 KB
/
pytest.yaml
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
name: Tests
on:
push:
pull_request:
jobs:
Tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 100
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
pycalphad_develop_version: [true, false]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch the entire repo history, required to guarantee setuptools_scm will pick up tags
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install -U pip setuptools
- name: Install pycalphad development version
if: matrix.pycalphad_develop_version
run: python -m pip install git+https://github.com/pycalphad/pycalphad.git@develop
- name: Save pycalphad version
run: |
echo "PYCALPHAD_VERSION=$(python -c "from importlib.metadata import version;print(version('pycalphad'))")" >> $GITHUB_ENV
- run: python -m pip install build
- run: python -m build --wheel
- run: python -m pip install dist/*.whl
- run: python -m pip install pytest
- run: python -m pip list
# pytest:
# - The `--import-mode=append` and `--pyargs kawin` flags test the installed package over the local one
# - The `--cov` flag is required to turn on coverage
- run: pytest -v --import-mode=append --cov --cov-config=pyproject.toml --pyargs kawin
- run: coverage xml
- uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}-pycalphad-${{ env.PYCALPHAD_VERSION }}
path: coverage.xml
Upload-Coverage:
runs-on: ubuntu-latest
needs: [Tests]
steps:
# The source code _must_ be checked out for coverage to be processed at Codecov.
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: coverage-*
- name: Upload to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true