Skip to content

Commit

Permalink
Merge pull request #38 from samueljsb/ci-parallel
Browse files Browse the repository at this point in the history
ci parallel
  • Loading branch information
samueljsb authored Jul 16, 2024
2 parents 2f3eb3b + 85d4327 commit 2e7ac73
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
tags:
- v*

# Only allow one instance of this workflow for each PR.
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
paths:
- requirements*

# Only allow one instance of this workflow for each PR.
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
compile:
runs-on: ubuntu-latest
Expand Down
28 changes: 22 additions & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
name: tests

on: [push]
on:
pull_request:
push:
branches: [main]

# Only allow one instance of this workflow for each PR.
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
python-version: |
3.9
3.10
3.11
3.12
allow-prereleases: true
cache: 'pip'
cache-dependency-path: |
requirements.txt
setup.cfg
tox.ini
- run: python -m pip install tox
- run: tox -e py
- run: tox run-parallel --parallel-no-spinner
env:
FORCE_COLOR: true
19 changes: 17 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
[tox]
envlist = py39,py310,py311,py312
envlist = py39,py310,py311,py312,report

[testenv]
# Install wheels instead of source distributions for faster execution.
package = wheel
# Share the build environment between tox environments.
wheel_build_env = .pkg

deps = -rrequirements.txt
commands =
coverage run --parallel-mode -m pytest {posargs:tests}

[testenv:clean]
skip_install = true
commands =
coverage erase
coverage run -m pytest {posargs:tests}

[testenv:report]
skip_install = true
depends = py310,py311,py312
commands =
coverage combine
coverage report

0 comments on commit 2e7ac73

Please sign in to comment.