5
5
- cron : ' 0 4 * * *'
6
6
workflow_dispatch :
7
7
8
- # # COMMENTED OUT: only for testing CI action changes
8
+ # # COMMENTED OUT: only for testing CI action changes.
9
+ # # It only works for PRs to `main` branch from branches in the upstream gt4py repo.
9
10
# pull_request:
10
11
# branches:
11
12
# - main
@@ -15,106 +16,87 @@ jobs:
15
16
daily-ci :
16
17
strategy :
17
18
matrix :
19
+ # dependencies-strategy -> The strategy that `uv lock` should use to select
20
+ # between the different compatible versions for a given package requirement
21
+ # [arg: --resolution, env: UV_RESOLUTION=]
22
+ dependencies-strategy : ["lowest-direct", "highest"]
23
+ gt4py-module : ["cartesian", "eve", "next", "storage"]
24
+ os : ["ubuntu-latest"] # , "macos-latest"]
18
25
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"]
22
26
fail-fast : false
23
27
24
28
runs-on : ${{ matrix.os }}
25
29
steps :
26
30
- uses : actions/checkout@v4
31
+
27
32
- name : Install C++ libraries
28
33
if : ${{ matrix.os == 'macos-latest' }}
29
34
shell : bash
30
- run : |
31
- brew install boost
35
+ run : brew install boost
36
+
32
37
- name : Install C++ libraries
33
38
if : ${{ matrix.os == 'ubuntu-latest' }}
34
39
shell : bash
35
- run : |
36
- sudo apt install libboost-dev
37
- - name : Set up Python ${{ matrix. python-version }}
38
- uses : actions /setup-python @v5
40
+ run : sudo apt install libboost-dev
41
+
42
+ - name : Install uv and set the python version
43
+ uses : astral-sh /setup-uv @v5
39
44
with :
45
+ enable-cache : true
46
+ cache-dependency-glob : " uv.lock"
40
47
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/[email protected]
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
48
+
49
+ - name : Run CPU tests for '${{ matrix.gt4py-module }}' with '${{ matrix.dependencies-strategy }}' resolution strategy
97
50
env :
98
51
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
52
+ UV_RESOLUTION : ${{ matrix.dependencies-strategy }}
53
+ run : uv run nox -s 'test_${{ matrix.gt4py-module }}-${{ matrix.python-version }}' -t 'cpu'
54
+
102
55
- name : Notify slack
103
56
if : ${{ failure() }}
104
57
env :
105
58
SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
106
59
107
60
with :
108
- channel-id : ${{ vars.SLACK_BOT_CHANNEL }}
61
+ channel-id : ${{ vars.SLACK_BOT_CHANNEL }} # Use SLACK_BOT_CHANNEL_TEST for testing
62
+ payload : |
63
+ {
64
+ "text": "Failed tests for ${{ github.workflow }} (dependencies-strategy=${{ matrix.dependencies-strategy }}, python=${{ matrix.python-version }}, component=${{ matrix.gt4py-module }}) [https://github.com/GridTools/gt4py/actions/runs/${{ github.run_id }}].",
65
+ "blocks": [
66
+ {
67
+ "type": "section",
68
+ "text": {
69
+ "type": "mrkdwn",
70
+ "text": "Failed tests: <https://github.com/GridTools/gt4py/actions/runs/${{ github.run_id }}|${{ github.workflow }}: **${{ matrix.gt4py-module }} (CPU)** for **Python-${{ matrix.python-version }}** with **'${{ matrix.dependencies-strategy }}' uv resolution strategy**.>"
71
+ }
72
+ }
73
+ ]
74
+ }
75
+
76
+ weekly-reminder :
77
+ runs-on : ubuntu-latest
78
+ steps :
79
+ - id : get_day_of_the_week
80
+ name : Get day of the week
81
+ run : echo "day_of_week=$(date +'%u')" >> $GITHUB_OUTPUT
82
+
83
+ - name : Weekly notification
84
+ if : ${{ env.DAY_OF_WEEK == 1 }}
85
+ env :
86
+ DAY_OF_WEEK : ${{ steps.get_day_of_the_week.outputs.day_of_week }}
87
+ SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
88
+
89
+ with :
90
+ channel-id : ${{ vars.SLACK_BOT_CHANNEL }} # Use SLACK_BOT_CHANNEL_TEST for testing
109
91
payload : |
110
92
{
111
- "text": "${{ github.workflow }}: `test-${{ matrix.tox-module-factor }}-cpu (python${{ matrix.python-version }})`>: *Failed tests!* ",
93
+ "text": "Weekly reminder to check the latest runs of the GT4Py Daily CI workflow at the GitHub Actions dashboard [https://github.com/GridTools/gt4py/actions/workflows/daily-ci.yml]. ",
112
94
"blocks": [
113
95
{
114
96
"type": "section",
115
97
"text": {
116
98
"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!* "
99
+ "text": "Weekly reminder to check the latest runs of the <https://github.com/GridTools/gt4py/actions/workflows/daily-ci.yml|GT4Py Daily CI> workflow at the GitHub Actions dashboard. "
118
100
}
119
101
}
120
102
]
0 commit comments