Skip to content

Commit 1a15a2c

Browse files
committed
Update GitHub CI
1 parent 93f368b commit 1a15a2c

10 files changed

Lines changed: 115 additions & 241 deletions

‎.github/workflows/code-quality.yml‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16-
- name: Set up Python
16+
17+
- name: "Set up Python"
1718
uses: actions/setup-python@v5
1819
with:
19-
python-version: "3.10"
20-
cache: 'pip'
21-
cache-dependency-path: |
22-
**/pyproject.toml
23-
**/constraints.txt
24-
**/requirements-dev.txt
25-
- uses: pre-commit/action@v3.0.1
20+
python-version-file: ".python-version"
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v5
24+
with:
25+
enable-cache: true
26+
cache-dependency-glob: "uv.lock"
27+
28+
- name: "Run pre-commit"
29+
uses: pre-commit/action@v3.0.1

‎.github/workflows/daily-ci.yml‎

Lines changed: 27 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -5,100 +5,52 @@ on:
55
- cron: '0 4 * * *'
66
workflow_dispatch:
77

8-
## COMMENTED OUT: only for testing CI action changes
9-
# pull_request:
10-
# branches:
11-
# - main
12-
## END
8+
# COMMENTED OUT: only for testing CI action changes
9+
pull_request:
10+
branches:
11+
- main
12+
# END
1313

1414
jobs:
1515
daily-ci:
1616
strategy:
1717
matrix:
18+
dependencies-factor: ["lowest-direct", "highest"]
19+
module-factor: ["cartesian", "eve", "next", "storage"]
20+
os: ["ubuntu-latest"] #, "macos-latest"]
1821
python-version: ["3.10", "3.11"]
19-
tox-module-factor: ["cartesian", "eve", "next", "storage"]
20-
os: ["ubuntu-latest"]
21-
requirements-file: ["requirements-dev.txt", "min-requirements-test.txt", "min-extra-requirements-test.txt"]
2222
fail-fast: false
2323

2424
runs-on: ${{ matrix.os }}
2525
steps:
2626
- uses: actions/checkout@v4
27+
2728
- name: Install C++ libraries
2829
if: ${{ matrix.os == 'macos-latest' }}
2930
shell: bash
30-
run: |
31-
brew install boost
31+
run: brew install boost
32+
3233
- name: Install C++ libraries
3334
if: ${{ matrix.os == 'ubuntu-latest' }}
3435
shell: bash
35-
run: |
36-
sudo apt install libboost-dev
37-
- name: Set up Python ${{ matrix.python-version }}
38-
uses: actions/setup-python@v5
36+
run: sudo apt install libboost-dev
37+
38+
- name: Install uv and set the python version
39+
uses: astral-sh/setup-uv@v5
3940
with:
41+
enable-cache: true
42+
cache-dependency-glob: "uv.lock"
4043
python-version: ${{ matrix.python-version }}
41-
cache: 'pip'
42-
cache-dependency-path: |
43-
**/pyproject.toml
44-
**/constraints.txt
45-
**/requirements-dev.txt
46-
- name: Install tox
47-
run: |
48-
python -m pip install -c ./constraints.txt pip setuptools wheel tox
49-
python -m pip list
50-
- name: Update requirements
51-
run: |
52-
pyversion=${{ matrix.python-version }}
53-
pyversion_no_dot=${pyversion//./}
54-
tox run -e requirements-py${pyversion_no_dot}
55-
# TODO(egparedes): add notification for dependencies updates
56-
# - name: Check for updated requirements
57-
# id: update-requirements
58-
# continue-on-error: true
59-
# if: ${{ matrix.python-version == '3.8' && matrix.tox-module-factor == 'cartesian' }}
60-
# shell: bash
61-
# run: |
62-
# if diff -q constraints.txt CURRENT-constraints.txt; then
63-
# echo "REQS_DIFF=''" >> $GITHUB_OUTPUT
64-
# else
65-
# diff --changed-group-format='%<' --unchanged-group-format='' constraints.txt CURRENT-constraints.txt | tr '\n' ' ' > constraints.txt.diff
66-
# echo "REQS_DIFF='$(cat constraints.txt.diff)'" >> $GITHUB_OUTPUT
67-
# fi
68-
# echo "REQS_DIFF_TEST="FOOOOOOOO" >> $GITHUB_OUTPUT
69-
# - name: Notify updated requirements (if any)
70-
# if: ${{ steps.update-requirements.outputs.REQS_DIFF }}
71-
# env:
72-
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
73-
# uses: slackapi/slack-github-action@v1.23.0
74-
# with:
75-
# channel-id: ${{ vars.SLACK_BOT_CHANNEL }}
76-
# payload: |
77-
# {
78-
# "text": "TEXT",
79-
# "blocks": [
80-
# {
81-
# "type": "section",
82-
# "text": {
83-
# "type": "plain_text",
84-
# "text": "@channel: AA/${{ steps.update-requirements.outputs.REQS_DIFF }}/BB/ ${{ steps.update-requirements.outputs.REQS_DIFF_TEST }} /CC"
85-
# }
86-
# },
87-
# {
88-
# "type": "section",
89-
# "text": {
90-
# "type": "mrkdwn",
91-
# "text": "@channel: AA/${{ steps.update-requirements.outputs.REQS_DIFF }}/BB/ ${{ steps.update-requirements.outputs.REQS_DIFF_TEST }} /CC"
92-
# }
93-
# }
94-
# ]
95-
# }
96-
- name: Run tests
44+
45+
# - name: Update requirements
46+
# run: uv lock --resolution=${{ matrix.dependencies-factor }} --prerelease=allow
47+
48+
- name: Run CPU tests for '${{ matrix.module-factor }}' with '${{ matrix.dependencies-factor }}' resolution strategy
9749
env:
9850
NUM_PROCESSES: auto
99-
ENV_REQUIREMENTS_FILE: ${{ matrix.requirements-file }}
100-
run: |
101-
tox run --skip-missing-interpreters -m test-${{ matrix.tox-module-factor }}-cpu
51+
UV_RESOLUTION: ${{ matrix.dependencies-factor }}
52+
run: uv run nox -s '${{ matrix.module-factor }}_tests-${{ matrix.python-version }}' -t 'cpu'
53+
10254
- name: Notify slack
10355
if: ${{ failure() }}
10456
env:
@@ -108,13 +60,13 @@ jobs:
10860
channel-id: ${{ vars.SLACK_BOT_CHANNEL }}
10961
payload: |
11062
{
111-
"text": "${{ github.workflow }}: `test-${{ matrix.tox-module-factor }}-cpu (python${{ matrix.python-version }})`>: *Failed tests!*",
63+
"text": "${{ github.workflow }}: `Daily CI: '**${{ matrix.module-factor }} (CPU)** for **Python-${{ matrix.python-version }}**>: *Failed tests!*",
11264
"blocks": [
11365
{
11466
"type": "section",
11567
"text": {
11668
"type": "mrkdwn",
117-
"text": "<https://github.com/GridTools/gt4py/actions/runs/${{ github.run_id }}|${{ github.workflow }}: `test-${{ matrix.tox-module-factor }}-cpu (python${{ matrix.python-version }})`>: *Failed tests!*"
69+
"text": "<https://github.com/GridTools/gt4py/actions/runs/${{ github.run_id }}|${{ github.workflow }}: **${{ matrix.module-factor }} (CPU)** for **Python-${{ matrix.python-version }}**>: *Failed tests!*"
11870
}
11971
}
12072
]

‎.github/workflows/test-cartesian-fallback.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ on:
1313

1414
jobs:
1515
test-cartesian:
16-
runs-on: ubuntu-latest
1716
strategy:
1817
matrix:
18+
codegen-factor: [internal, dace]
19+
os: ["ubuntu-latest"]
1920
python-version: ["3.10", "3.11"]
20-
tox-factor: [internal, dace]
21-
21+
runs-on: ${{ matrix.os }}
2222
steps:
2323
- run: 'echo "No build required"'

‎.github/workflows/test-cartesian.yml‎

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,36 @@ concurrency:
2020

2121
jobs:
2222
test-cartesian:
23-
runs-on: ubuntu-latest
2423
strategy:
2524
matrix:
25+
codegen-factor: [internal, dace]
26+
os: ["ubuntu-latest"]
2627
python-version: ["3.10", "3.11"]
27-
tox-factor: [internal, dace]
28+
fail-fast: false
29+
30+
runs-on: ${{ matrix.os }}
2831
steps:
2932
- uses: actions/checkout@v4
33+
3034
- name: Install C++ libraries
35+
if: ${{ matrix.os == 'macos-latest' }}
3136
shell: bash
32-
run: |
33-
sudo apt install libboost-dev
34-
- name: Set up Python ${{ matrix.python-version }}
35-
uses: actions/setup-python@v5
37+
run: brew install boost
38+
39+
- name: Install C++ libraries
40+
if: ${{ matrix.os == 'ubuntu-latest' }}
41+
shell: bash
42+
run: sudo apt install libboost-dev
43+
44+
- name: Install uv and set the python version
45+
uses: astral-sh/setup-uv@v5
3646
with:
47+
enable-cache: true
48+
cache-dependency-glob: "uv.lock"
3749
python-version: ${{ matrix.python-version }}
38-
cache: 'pip'
39-
cache-dependency-path: |
40-
**/pyproject.toml
41-
**/constraints.txt
42-
**/requirements-dev.txt
43-
- name: Install python dependencies
44-
run: |
45-
python -m pip install -c ./constraints.txt pip setuptools wheel
46-
python -m pip install -r ./requirements-dev.txt
47-
- name: Test with tox
50+
51+
- name: Run CPU 'cartesian' tests with nox
4852
env:
4953
NUM_PROCESSES: auto
5054
shell: bash
51-
run: |
52-
pyversion=${{ matrix.python-version }}
53-
pyversion_no_dot=${pyversion//./}
54-
tox run -e cartesian-py${pyversion_no_dot}-${{ matrix.tox-factor }}-cpu
55+
run: uv run nox -s 'cartesian_tests-${{ matrix.python-version }}(${{ matrix.codegen-factor }}, cpu)'

‎.github/workflows/test-eve-fallback.yml‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
name: "Fallback: Test Eve"
22

33
on:
4+
push:
5+
branches:
6+
- main
47
pull_request:
58
branches:
69
- main
710
paths-ignore: # Inverse of corresponding workflow
811
- "src/gt4py/eve/**"
912
- "tests/eve_tests/**"
10-
- "workflows/**"
11-
- "*.cfg"
12-
- "*.ini"
13+
- ".github/workflows/**"
14+
- "*.lock"
1315
- "*.toml"
1416
- "*.yml"
1517

1618
jobs:
1719
test-eve:
1820
strategy:
1921
matrix:
20-
python-version: ["3.10", "3.11"]
2122
os: ["ubuntu-latest"]
23+
python-version: ["3.10", "3.11"]
2224

2325
runs-on: ${{ matrix.os }}
2426
steps:

‎.github/workflows/test-eve.yml‎

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,61 +10,32 @@ on:
1010
paths: # Run when gt4py.eve files (or package settings) are changed
1111
- "src/gt4py/eve/**"
1212
- "tests/eve_tests/**"
13-
- "workflows/**"
14-
- "*.cfg"
15-
- "*.ini"
13+
- ".github/workflows/**"
14+
- "*.lock"
1615
- "*.toml"
1716
- "*.yml"
1817

1918
jobs:
2019
test-eve:
2120
strategy:
2221
matrix:
23-
python-version: ["3.10", "3.11"]
2422
os: ["ubuntu-latest"]
23+
python-version: ["3.10", "3.11"]
2524
fail-fast: false
2625

2726
runs-on: ${{ matrix.os }}
2827
steps:
2928
- uses: actions/checkout@v4
30-
- name: Set up Python ${{ matrix.python-version }}
31-
uses: actions/setup-python@v5
29+
30+
- name: Install uv and set the python version
31+
uses: astral-sh/setup-uv@v5
3232
with:
33+
enable-cache: true
34+
cache-dependency-glob: "uv.lock"
3335
python-version: ${{ matrix.python-version }}
34-
cache: 'pip'
35-
cache-dependency-path: |
36-
**/pyproject.toml
37-
**/constraints.txt
38-
**/requirements-dev.txt
39-
- name: Install python dependencies
40-
run: |
41-
python -m pip install -c ./constraints.txt pip setuptools wheel
42-
python -m pip install -r ./requirements-dev.txt
43-
- name: Run tox tests
36+
37+
- name: Run 'eve' tests with nox
4438
env:
4539
NUM_PROCESSES: auto
4640
shell: bash
47-
run: |
48-
pyversion=${{ matrix.python-version }}
49-
pyversion_no_dot=${pyversion//./}
50-
tox run -e eve-py${pyversion_no_dot}
51-
# mv coverage.json coverage-py${{ matrix.python-version }}-${{ matrix.os }}.json
52-
# - name: Upload coverage.json artifact
53-
# uses: actions/upload-artifact@v3
54-
# with:
55-
# name: coverage-py${{ matrix.python-version }}-${{ matrix.os }}
56-
# path: coverage-py${{ matrix.python-version }}-${{ matrix.os }}.json
57-
# - name: Gather info
58-
# run: |
59-
# echo ${{ github.ref_type }} >> info.txt
60-
# echo ${{ github.ref }} >> info.txt
61-
# echo ${{ github.sha }} >> info.txt
62-
# echo ${{ github.event.number }} >> info.txt
63-
# echo ${{ github.event.pull_request.head.ref }} >> info.txt
64-
# echo ${{ github.event.pull_request.head.sha }} >> info.txt
65-
# echo ${{ github.run_id }} >> info.txt
66-
# - name: Upload info artifact
67-
# uses: actions/upload-artifact@v3
68-
# with:
69-
# name: info-py${{ matrix.python-version }}-${{ matrix.os }}
70-
# path: info.txt
41+
run: uv run nox -s eve_tests-${{ matrix.python-version }}

‎.github/workflows/test-next-fallback.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ jobs:
1515
test-next:
1616
strategy:
1717
matrix:
18-
python-version: ["3.10", "3.11"]
19-
tox-factor: ["nomesh", "atlas"]
18+
codegen-factor: [internal, dace]
19+
mesh-factor: [nomesh, atlas]
2020
os: ["ubuntu-latest"]
21+
python-version: ["3.10", "3.11"]
2122

2223
runs-on: ${{ matrix.os }}
2324
steps:

0 commit comments

Comments
 (0)