-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
137 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,13 +13,17 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
|
||
- name: "Set up Python" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
cache: 'pip' | ||
cache-dependency-path: | | ||
**/pyproject.toml | ||
**/constraints.txt | ||
**/requirements-dev.txt | ||
- uses: pre-commit/[email protected] | ||
python-version-file: ".python-version" | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: "uv.lock" | ||
|
||
- name: "Run pre-commit" | ||
uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,100 +5,52 @@ on: | |
- cron: '0 4 * * *' | ||
workflow_dispatch: | ||
|
||
## COMMENTED OUT: only for testing CI action changes | ||
# pull_request: | ||
# branches: | ||
# - main | ||
## END | ||
# COMMENTED OUT: only for testing CI action changes | ||
pull_request: | ||
branches: | ||
- main | ||
# END | ||
|
||
jobs: | ||
daily-ci: | ||
strategy: | ||
matrix: | ||
dependencies-factor: ["lowest-direct", "highest"] | ||
module-factor: ["cartesian", "eve", "next", "storage"] | ||
os: ["ubuntu-latest"] #, "macos-latest"] | ||
python-version: ["3.10", "3.11"] | ||
tox-module-factor: ["cartesian", "eve", "next", "storage"] | ||
os: ["ubuntu-latest"] | ||
requirements-file: ["requirements-dev.txt", "min-requirements-test.txt", "min-extra-requirements-test.txt"] | ||
fail-fast: false | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install C++ libraries | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
shell: bash | ||
run: | | ||
brew install boost | ||
run: brew install boost | ||
|
||
- name: Install C++ libraries | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
shell: bash | ||
run: | | ||
sudo apt install libboost-dev | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
run: sudo apt install libboost-dev | ||
|
||
- name: Install uv and set the python version | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: "uv.lock" | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
cache-dependency-path: | | ||
**/pyproject.toml | ||
**/constraints.txt | ||
**/requirements-dev.txt | ||
- name: Install tox | ||
run: | | ||
python -m pip install -c ./constraints.txt pip setuptools wheel tox | ||
python -m pip list | ||
- name: Update requirements | ||
run: | | ||
pyversion=${{ matrix.python-version }} | ||
pyversion_no_dot=${pyversion//./} | ||
tox run -e requirements-py${pyversion_no_dot} | ||
# TODO(egparedes): add notification for dependencies updates | ||
# - name: Check for updated requirements | ||
# id: update-requirements | ||
# continue-on-error: true | ||
# if: ${{ matrix.python-version == '3.8' && matrix.tox-module-factor == 'cartesian' }} | ||
# shell: bash | ||
# run: | | ||
# if diff -q constraints.txt CURRENT-constraints.txt; then | ||
# echo "REQS_DIFF=''" >> $GITHUB_OUTPUT | ||
# else | ||
# diff --changed-group-format='%<' --unchanged-group-format='' constraints.txt CURRENT-constraints.txt | tr '\n' ' ' > constraints.txt.diff | ||
# echo "REQS_DIFF='$(cat constraints.txt.diff)'" >> $GITHUB_OUTPUT | ||
# fi | ||
# echo "REQS_DIFF_TEST="FOOOOOOOO" >> $GITHUB_OUTPUT | ||
# - name: Notify updated requirements (if any) | ||
# if: ${{ steps.update-requirements.outputs.REQS_DIFF }} | ||
# env: | ||
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
# uses: slackapi/[email protected] | ||
# with: | ||
# channel-id: ${{ vars.SLACK_BOT_CHANNEL }} | ||
# payload: | | ||
# { | ||
# "text": "TEXT", | ||
# "blocks": [ | ||
# { | ||
# "type": "section", | ||
# "text": { | ||
# "type": "plain_text", | ||
# "text": "@channel: AA/${{ steps.update-requirements.outputs.REQS_DIFF }}/BB/ ${{ steps.update-requirements.outputs.REQS_DIFF_TEST }} /CC" | ||
# } | ||
# }, | ||
# { | ||
# "type": "section", | ||
# "text": { | ||
# "type": "mrkdwn", | ||
# "text": "@channel: AA/${{ steps.update-requirements.outputs.REQS_DIFF }}/BB/ ${{ steps.update-requirements.outputs.REQS_DIFF_TEST }} /CC" | ||
# } | ||
# } | ||
# ] | ||
# } | ||
- name: Run tests | ||
|
||
# - name: Update requirements | ||
# run: uv lock --resolution=${{ matrix.dependencies-factor }} --prerelease=allow | ||
|
||
- name: Run tests for '${{ matrix.module-factor }}' with '${{ matrix.dependencies-factor }}' resolution strategy | ||
env: | ||
NUM_PROCESSES: auto | ||
ENV_REQUIREMENTS_FILE: ${{ matrix.requirements-file }} | ||
run: | | ||
tox run --skip-missing-interpreters -m test-${{ matrix.tox-module-factor }}-cpu | ||
UV_RESOLUTION: ${{ matrix.dependencies-factor }} | ||
run: uv run nox -k '${{ matrix.python-version }} and ${{ matrix.module-factor }} and cpu' | ||
|
||
- name: Notify slack | ||
if: ${{ failure() }} | ||
env: | ||
|
@@ -108,13 +60,13 @@ jobs: | |
channel-id: ${{ vars.SLACK_BOT_CHANNEL }} | ||
payload: | | ||
{ | ||
"text": "${{ github.workflow }}: `test-${{ matrix.tox-module-factor }}-cpu (python${{ matrix.python-version }})`>: *Failed tests!*", | ||
"text": "${{ github.workflow }}: `Daily CI: '**${{ matrix.module-factor }} (CPU)** for **Python-${{ matrix.python-version }}**>: *Failed tests!*", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"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!*" | ||
"text": "<https://github.com/GridTools/gt4py/actions/runs/${{ github.run_id }}|${{ github.workflow }}: **${{ matrix.module-factor }} (CPU)** for **Python-${{ matrix.python-version }}**>: *Failed tests!*" | ||
} | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.