Merge pull request #10 from nury12n/workspace_compat #126
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |