Skip to content

Commit

Permalink
Fix Tox and CI (#100)
Browse files Browse the repository at this point in the history
* Switch to tox-gh-actions

* Revert to tox-gh

* Fix duplication of jobs on internal PRs.

* Add support for x86 in 3.12

* Move 3.12-dev to its own job matrix.

* Try tox-gh-actions again
  • Loading branch information
vivekjoshy committed Jul 10, 2023
1 parent 260879b commit 366af29
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/localization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
pull_request_base_branch_name: 'main'
pull_request_labels: 'translations'
pull_request_assignees: 'crowdin-bot'
pull_request_reviewers: 'daegontaven'
pull_request_reviewers: 'vivekjoshy'

pull_request_body: |
**This is an automated PR.**
Expand Down
110 changes: 92 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,120 @@
name: Tests
name: Platform Tests
on: [push, pull_request]

concurrency:
group: check-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
tests:
name: ${{ matrix.os }} / ${{ matrix.python-version }} ${{ matrix.architecture }}
cpython-stable:
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch. Without this if check, checks are duplicated since
# internal PRs match both the push and pull_request events.
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository
name: ${{ matrix.os }} / ${{ matrix.python-version }} (${{ matrix.architecture }})
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
fail-fast: true
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: ["3.8", "3.9", "3.10", "3.11", "pypy3.8", "pypy3.9", "pypy3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
architecture: ["x86", "x64"]
experimental: [false]
include:
- os: Ubuntu
python-version: "3.12-dev"
experimental: true
- os: MacOS
python-version: "3.12-dev"
experimental: true
- os: Windows
python-version: "3.12-dev"
experimental: true
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Stable CPython - ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: "**/pyproject.toml"
- name: Install Tox
run: python -m pip install tox-gh>=1.2.0
run: python -m pip install tox-gh-actions>=3.1.3
- name: Setup Test Suite
run: tox -vv --notest
- name: Run Tests
run: |
python -m pip install --upgrade pip
tox --skip-pkg-install
continue-on-error: ${{ matrix.experimental }}
- name: "Upload Coverage to Codecov"
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: ${{ !matrix.experimental }}
cpython-unstable:
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository
name: ${{ matrix.os }} / ${{ matrix.python-version }} (${{ matrix.architecture }})
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: true
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: ["3.12-dev"]
architecture: ["x86", "x64"]
experimental: [true]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Unstable CPython - ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: "**/pyproject.toml"
- name: Install Tox
run: python -m pip install tox-gh-actions>=3.1.3
- name: Setup Test Suite
run: tox -vv --notest
- name: Run Tests
run: |
python -m pip install --upgrade pip
tox --skip-pkg-install
continue-on-error: ${{ matrix.experimental }}
- name: "Upload Coverage to Codecov"
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: ${{ !matrix.experimental }}
pypy:
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository
name: ${{ matrix.os }} / ${{ matrix.python-version }} (${{ matrix.architecture }})
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: true
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: ["pypy3.8", "pypy3.9", "pypy3.10"]
architecture: ["x64"]
experimental: [false]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up PyPy - ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: "**/pyproject.toml"
- name: Install Tox
run: python -m pip install tox-gh-actions>=3.1.3
- name: Setup Test Suite
run: tox -vv --notest
- name: Run Tests
Expand Down
21 changes: 9 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
[gh]
python =
3.12-dev = py
3.12.0b3 = py3.12.0b3
3.11 = lint, build, py3.11
3.10 = py3.10
3.9 = py3.9
3.8 = py3.8
pypy3.10 = pypy3.10
pypy3.9 = pypy3.9
pypy3.8 = pypy3.8
3.12-dev: python3.12
3.11: lint, build, py3.11
3.10: py3.10
3.9: py3.9
3.8: py3.8
pypy-3.10: pypy3.10
pypy-3.9: pypy3.9
pypy-3.8: pypy3.8

[tox]
requires =
tox>=4
env_list =
lint
build
py
py{3.8,3.9,3.10,3.11}
py{3.8,3.9,3.10,3.11}-win32
py3.12.0b3
py3.12.0b3-win32
python3.12
pypy3.{8,9,10}
coverage

Expand Down

0 comments on commit 366af29

Please sign in to comment.