Merge pull request #11 from mdapena/sdist-size-optimization #41
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: | |
branches: | |
- master | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
jobs: | |
test: | |
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
python-version: [ "3.10", "3.11", "3.12" ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Ensure latest pip | |
run: python -m pip install --upgrade pip | |
- name: Install dependencies | |
run: pip install hatch | |
- name: Run all tests | |
run: hatch run +py=${{ matrix.python-version }} tests:all | |
- name: Coveralls Parallel | |
uses: coverallsapp/github-action@v2 | |
with: | |
files: coverage.xml | |
flag-name: py${{ matrix.python-version }}-${{ matrix.os }} | |
parallel: true | |
coveralls-finish: | |
needs: | |
- test | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/github-action@v2 | |
with: | |
parallel-finished: true | |
# https://github.com/marketplace/actions/alls-green#why | |
alls-green: # This job does nothing and is only used for the branch protection | |
if: always() | |
needs: | |
- coveralls-finish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Decide whether the needed jobs succeeded or failed | |
uses: re-actors/alls-green@release/v1 | |
with: | |
jobs: ${{ toJSON(needs) }} |