update deploy workflow #332
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: | |
| - "master" | |
| pull_request: | |
| branches: | |
| - "master" | |
| schedule: | |
| # Weekly tests run every Saturday on master by default: | |
| # Scheduled workflows run on the latest commit on the default or base branch. | |
| # (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule) | |
| - cron: "34 2 * * 6" | |
| concurrency: | |
| group: "${{ github.ref }}-${{ github.head_ref }}" | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| jobs: | |
| test: | |
| name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macOS-latest, ubuntu-latest, windows-latest] | |
| python-version: ["3.11", "3.12", "3.13", "3.14"] | |
| # Only test lowest and highest version on the expensive/slow | |
| # macOS and windows runners (UPDATE when supported versions change): | |
| exclude: | |
| - os: macOS-latest | |
| python-version: 3.12 | |
| - os: macOS-latest | |
| python-version: 3.13 | |
| - os: windows-latest | |
| python-version: 3.12 | |
| - os: windows-latest | |
| python-version: 3.13 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: mamba-org/setup-micromamba@main | |
| with: | |
| environment-file: devtools/conda-envs/test_env.yaml | |
| environment-name: test | |
| create-args: | | |
| python=${{ matrix.python-version }} | |
| - name: Install package | |
| run: | | |
| python -m pip install . --no-deps | |
| micromamba list | |
| - name: Run tests | |
| run: | | |
| pytest -v --cov=alchemtest --cov-report=xml --color=yes alchemtest/tests/ | |
| - name: CodeCov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} | |
| file: ./coverage.xml | |
| flags: unittests | |
| fail_ci_if_error: true | |
| pypi_check: | |
| name: Check source package integrity (for PyPi deployment) | |
| if: "github.repository == 'alchemistry/alchemtest'" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.12 | |
| - name: Install tools | |
| run: | | |
| python -m pip install twine build | |
| - name: Build alchemtest source dist | |
| run: | | |
| python -m build --sdist --wheel --outdir dist/ | |
| - name: Check package build sdist | |
| run: | | |
| DISTRIBUTION=$(ls -t1 dist/alchemtest-*.tar.gz | head -n 1) | |
| test -n "${DISTRIBUTION}" || { echo "no distribution dist/alchemtest-*.tar.gz found"; exit 1; } | |
| echo "twine check $DISTRIBUTION" | |
| twine check $DISTRIBUTION |