Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: enhance CI workflows and make them consistent (tox and GH actions) #1590

Merged
merged 29 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
cf8a8d3
Simplify tox generative environment names and related CI actions
egparedes Jul 25, 2024
c3c70f4
Fix format
egparedes Jul 25, 2024
91b6548
Fix dev env factor
egparedes Jul 25, 2024
d10cc42
Fix 'internal' renaming leftovers
egparedes Jul 25, 2024
458ff9c
More leftovers of the removal of dummy markers
egparedes Jul 25, 2024
99a33cd
Put back the removed internal and nomesh factors
egparedes Jul 26, 2024
18c27f9
Fix typos
egparedes Jul 26, 2024
01a795c
Hardcode cpu factor in CI tests
egparedes Jul 26, 2024
c8ff4e3
Revert back to internal factor in docs
egparedes Jul 26, 2024
665e563
Fix format
egparedes Jul 26, 2024
d1942f4
Reorder conditions
egparedes Jul 26, 2024
4da05fd
Fix typo
egparedes Jul 26, 2024
690cdb4
Comment out again doctests in storage
egparedes Jul 26, 2024
1e16e90
Format issues
egparedes Jul 26, 2024
1bff3cb
Restore dev factors
egparedes Jul 26, 2024
27c92b0
Merge branch 'main' into add-next-dace-tox-factor
egparedes Jul 26, 2024
9acadec
Merge branch 'main' into add-next-dace-tox-factor
havogt Jul 31, 2024
8adc941
Merge branch 'main' into add-next-dace-tox-factor
egparedes Sep 2, 2024
daec4cb
Add custom pytest option to vaoid returning an exit code error if the…
egparedes Sep 2, 2024
41ea301
Merge branch 'main' into add-next-dace-tox-factor
egparedes Sep 3, 2024
77e579e
Use pytest plugin to suppress no-tests-collected errors instead of cu…
egparedes Sep 3, 2024
9df7ef1
Merge branch 'main' into add-next-dace-tox-factor
egparedes Sep 3, 2024
c51dc75
Update dependencies again
egparedes Sep 3, 2024
1cf88a7
Recover updated tox.ini
egparedes Sep 3, 2024
985cfa3
Update links in the development docs.
egparedes Sep 3, 2024
0b4a6b7
Update link URL
egparedes Sep 3, 2024
59ff62e
Remove linters again
egparedes Sep 3, 2024
5242d80
Format issues
egparedes Sep 3, 2024
922fb25
F
egparedes Sep 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-cartesian-fallback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
backends: [internal-cpu, dace-cpu]
tox-factor: [internal, dace]

steps:
- run: 'echo "No build required"'
4 changes: 2 additions & 2 deletions .github/workflows/test-cartesian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
backends: [internal-cpu, dace-cpu]
tox-factor: [internal, dace]
steps:
- uses: actions/checkout@v2
- name: Install boost
Expand Down Expand Up @@ -59,4 +59,4 @@ jobs:
run: |
pyversion=${{ matrix.python-version }}
pyversion_no_dot=${pyversion//./}
tox run -e cartesian-py${pyversion_no_dot}-${{ matrix.backends }}
tox run -e cartesian-py${pyversion_no_dot}-${{ matrix.tox-factor }}-cpu
2 changes: 1 addition & 1 deletion .github/workflows/test-next-fallback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
python-version: ["3.10", "3.11"]
tox-env-factor: ["nomesh", "atlas"]
tox-factor: ["nomesh", "atlas"]
os: ["ubuntu-latest"]

runs-on: ${{ matrix.os }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
python-version: ["3.10", "3.11"]
tox-env-factor: ["nomesh", "atlas"]
tox-factor: ["nomesh", "atlas"]
os: ["ubuntu-latest"]
fail-fast: false

Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
run: |
pyversion=${{ matrix.python-version }}
pyversion_no_dot=${pyversion//./}
tox run -e next-py${pyversion_no_dot}-${{ matrix.tox-env-factor }}-cpu
tox run -e next-py${pyversion_no_dot}-${{ matrix.tox-factor }}-cpu
# mv coverage.json coverage-py${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.tox-env-factor }}-cpu.json
# - name: Upload coverage.json artifact
# uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-storage-fallback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
backends: [internal-cpu, dace-cpu]
tox-factor: [internal, dace]
os: ["ubuntu-latest"]

runs-on: ${{ matrix.os }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
backends: [internal-cpu, dace-cpu]
tox-factor: [internal, dace]
os: ["ubuntu-latest"]
fail-fast: false

Expand All @@ -51,7 +51,7 @@ jobs:
run: |
pyversion=${{ matrix.python-version }}
pyversion_no_dot=${pyversion//./}
tox run -e storage-py${pyversion_no_dot}-${{ matrix.backends }}
tox run -e storage-py${pyversion_no_dot}-${{ matrix.tox-factor }}-cpu
# mv coverage.json coverage-py${{ matrix.python-version }}-${{ matrix.os }}.json
# - name: Upload coverage.json artifact
# uses: actions/upload-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ repos:
hooks:
- id: pretty-format-ini
args: [--autofix]
exclude: tox.ini
- id: pretty-format-toml
args: [--autofix]
- id: pretty-format-yaml
Expand Down
70 changes: 35 additions & 35 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,24 @@ requires =
envlist =
cartesian-py{310}-{internal,dace}-{cpu}
eve-py{310}
next-py{310}-{nomesh,atlas}
next-py{310}-{nomesh,atlas}-{cpu}
storage-py{310}-{internal,dace}-{cpu}
linters-py{310}
# docs
# docs
labels =
test-cartesian-cpu = cartesian-py38-internal-cpu, cartesian-py39-internal-cpu, cartesian-py310-internal-cpu, \
cartesian-py311-internal-cpu, cartesian-py38-dace-cpu, cartesian-py39-dace-cpu, cartesian-py310-dace-cpu, \
cartesian-py311-dace-cpu

test-cartesian-cpu = cartesian-py38-internal-cpu, cartesian-internal-py39-cpu, \
cartesian-internal-py310-cpu, cartesian-py311-internal-cpu, \
cartesian-py38-dace-cpu, cartesian-py39-dace-cpu, cartesian-py310-dace-cpu, cartesian-py311-dace-cpu
test-eve-cpu = eve-py38, eve-py39, eve-py310, eve-py311

test-next-cpu = next-py310-nomesh, next-py311-nomesh, next-py310-atlas, next-py311-atlas

test-storage-cpu = storage-py38-internal-cpu, storage-py39-internal-cpu, storage-py310-internal-cpu, \
storage-py311-internal-cpu, storage-py38-dace-cpu, storage-py39-dace-cpu, storage-py310-dace-cpu, \
storage-py311-dace-cpu

test-cpu = cartesian-py38-internal-cpu, cartesian-py39-internal-cpu, cartesian-py310-internal-cpu, \
cartesian-py311-internal-cpu, cartesian-py38-dace-cpu, cartesian-py39-dace-cpu, cartesian-py310-dace-cpu, \
cartesian-py311-dace-cpu, \
eve-py38, eve-py39, eve-py310, eve-py311, \
next-py310-nomesh, next-py311-nomesh, next-py310-atlas, next-py311-atlas, \
storage-py38-internal-cpu, storage-py39-internal-cpu, storage-py310-internal-cpu, storage-py311-internal-cpu, \
storage-py38-dace-cpu, storage-py39-dace-cpu, storage-py310-dace-cpu, storage-py311-dace-cpu
test-next-cpu = next-py310-nomesh-cpu, next-py311-nomesh-cpu, next-py310-atlas-cpu, next-py311-atlas-cpu
test-storage-cpu = storage-py38-internal-cpu, storage-py39-internal-cpu, storage-py310-internal-cpu, storage-py311-internal-cpu, \
storage-py38-dace-cpu, storage-py39-dace-cpu, storage-py310-dace-cpu, storage-py311-dace-cpu
test-cpu = cartesian-py38-internal-cpu, cartesian-py39-internal-cpu, cartesian-py310-internal-cpu, cartesian-py311-internal-cpu, \
cartesian-py38-dace-cpu, cartesian-py39-dace-cpu, cartesian-py310-dace-cpu, cartesian-py311-dace-cpu, \
eve-py38, eve-py39, eve-py310, eve-py311, \
next-py310-nomesh-cpu, next-py311-nomesh-cpu, next-py310-atlas-cpu, next-py311-atlas-cpu, \
storage-py38-internal-cpu, storage-py39-internal-cpu, storage-py310-internal-cpu, storage-py311-internal-cpu, \
storage-py38-dace-cpu, storage-py39-dace-cpu, storage-py310-dace-cpu, storage-py311-dace-cpu

[testenv]
deps = -r {tox_root}{/}{env:ENV_REQUIREMENTS_FILE:requirements-dev.txt}
Expand All @@ -46,7 +40,7 @@ wheel_build_env = .pkg
pass_env = CUDAARCHS, NUM_PROCESSES, GT4PY_*
set_env =
PYTEST_ADDOPTS = --color=auto --instafail
PYTHONWARNINGS = {env:PYTHONWARNINGS:ignore:Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*:UserWarning,ignore:Field View Program ':UserWarning}
PYTHONWARNINGS = {env:PYTHONWARNINGS:ignore:Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*:UserWarning,ignore:Field View Program:UserWarning}

# -- Primary tests --
[testenv:cartesian-py{38,39,310,311}-{internal,dace}-{cpu,cuda,cuda11x,cuda12x}]
Expand All @@ -59,16 +53,18 @@ allowlist_externals =
ldd
rm
commands =
internal-cpu: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "not requires_gpu and not requires_dace" {posargs} tests{/}cartesian_tests
internal-{cuda,cuda11x,cuda12x}: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "requires_gpu and not requires_dace" {posargs} tests{/}cartesian_tests
dace-cpu: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "not requires_gpu and requires_dace" {posargs} tests{/}cartesian_tests
dace-{cuda,cuda11x,cuda12x}: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "requires_gpu and requires_dace" {posargs} tests{/}cartesian_tests
python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "\
internal: not requires_dace \
dace: requires_dace \
cpu: and not requires_gpu \
{cuda,cuda11x,cuda12x}: and requires_gpu \
" {posargs} tests{/}cartesian_tests
python -m pytest --doctest-modules --doctest-ignore-import-errors src{/}gt4py{/}cartesian
# commands_pre =
# rm -Rf tests/_reports/coverage*
;commands_post =
; coverage json --rcfile=setup.cfg
; coverage html --rcfile=setup.cfg --show-contexts
# commands_post =
# coverage json --rcfile=setup.cfg
# coverage html --rcfile=setup.cfg --show-contexts

[testenv:eve-py{38,39,310,311}]
description = Run 'gt4py.eve' tests
Expand All @@ -86,18 +82,22 @@ set_env =
{[testenv]set_env}
PIP_EXTRA_INDEX_URL = {env:PIP_EXTRA_INDEX_URL:https://test.pypi.org/simple/}
commands =
nomesh-cpu: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "not requires_atlas and not requires_gpu" {posargs} tests{/}next_tests
nomesh-{cuda,cuda11x,cuda12x}: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "not requires_atlas and requires_gpu" {posargs} tests{/}next_tests
atlas-cpu: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "requires_atlas and not requires_gpu" {posargs} tests{/}next_tests
# atlas-{cuda,cuda11x,cuda12x}: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "requires_atlas and requires_gpu" {posargs} tests{/}next_tests # TODO(ricoh): activate when such tests exist
python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "\
nomesh: not requires_atlas \
atlas: requires_atlas \
cpu: and not requires_gpu \
{cuda,cuda11x,cuda12x}: and requires_gpu \
" {posargs} tests{/}next_tests
pytest --doctest-modules src{/}gt4py{/}next

[testenv:storage-py{38,39,310,311}-{internal,dace}-{cpu,cuda,cuda11x,cuda12x}]
description = Run 'gt4py.storage' tests
commands =
cpu: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "not requires_gpu" {posargs} tests{/}storage_tests
{cuda,cuda11x,cuda12x}: python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "requires_gpu" {posargs} tests{/}storage_tests
#pytest doctest-modules {posargs} src{/}gt4py{/}storage
python -m pytest --cache-clear -v -n {env:NUM_PROCESSES:1} -m "\
cpu: not requires_gpu \
{cuda,cuda11x,cuda12x}: requires_gpu \
" {posargs} tests{/}storage_tests
# pytest doctest-modules {posargs} src{/}gt4py{/}storage

# -- Secondary tests --
[testenv:linters-py{38,39,310,311}]
Expand Down
Loading