Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
egparedes committed Jan 22, 2025
1 parent 1a15a2c commit 65d09f1
Show file tree
Hide file tree
Showing 9 changed files with 189 additions and 292 deletions.
128 changes: 99 additions & 29 deletions .github/workflows/daily-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
- cron: '0 4 * * *'
workflow_dispatch:

# COMMENTED OUT: only for testing CI action changes
# COMMENTED OUT: only for testing CI action changes.
# It only works for PRs to `main` branch from branches in the same gt4py repo.
pull_request:
branches:
- main
Expand All @@ -23,51 +24,120 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Install C++ libraries
if: ${{ matrix.os == 'macos-latest' }}
shell: bash
run: brew install boost
- name: Get current date
id: date
run: |
echo "{day_of_the_week}={$(date +'%u')}" >> $GITHUB_STATE
- name: Install C++ libraries
if: ${{ matrix.os == 'ubuntu-latest' }}
shell: bash
run: sudo apt install libboost-dev

- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
- name: Weekly notification
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: slackapi/slack-github-action@v1.23.0
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
python-version: ${{ matrix.python-version }}

# - name: Update requirements
# run: uv lock --resolution=${{ matrix.dependencies-factor }} --prerelease=allow
channel-id: ${{ vars.SLACK_BOT_CHANNEL_TEST }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"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 <https://github.com/GridTools/gt4py/actions/|GitHub Actions dashboard>."
}
}
]
}
- name: Run CPU tests for '${{ matrix.module-factor }}' with '${{ matrix.dependencies-factor }}' resolution strategy
- name: Test with environment variables
if: ${{ env.day_of_the_week == '3' }}
env:
NUM_PROCESSES: auto
UV_RESOLUTION: ${{ matrix.dependencies-factor }}
run: uv run nox -s '${{ matrix.module-factor }}_tests-${{ matrix.python-version }}' -t 'cpu'

- name: Notify slack
if: ${{ failure() }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: slackapi/slack-github-action@v1.23.0
with:
channel-id: ${{ vars.SLACK_BOT_CHANNEL_TEST }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "if3 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 <https://github.com/GridTools/gt4py/actions/|GitHub Actions dashboard>."
}
}
]
}
- name: Test not
if: ${{ env.day_of_the_week != '3' }}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: slackapi/slack-github-action@v1.23.0
with:
channel-id: ${{ vars.SLACK_BOT_CHANNEL }}
channel-id: ${{ vars.SLACK_BOT_CHANNEL_TEST }}
payload: |
{
"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 }}: **${{ matrix.module-factor }} (CPU)** for **Python-${{ matrix.python-version }}**>: *Failed tests!*"
"text": "ifnot3 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 <https://github.com/GridTools/gt4py/actions/|GitHub Actions dashboard>."
}
}
]
}
# - uses: actions/checkout@v4

# - name: Install C++ libraries
# if: ${{ matrix.os == 'macos-latest' }}
# shell: bash
# run: brew install boost

# - name: Install C++ libraries
# if: ${{ matrix.os == 'ubuntu-latest' }}
# shell: bash
# 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 }}

# - name: Run CPU tests for '${{ matrix.module-factor }}' with '${{ matrix.dependencies-factor }}' resolution strategy
# env:
# NUM_PROCESSES: auto
# UV_RESOLUTION: ${{ matrix.dependencies-factor }}
# run: uv run nox -s 'test_${{ matrix.module-factor }}-${{ matrix.python-version }}' -t 'cpu'


# - name: Notify slack
# #if: ${{ failure() }}
# env:
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
# uses: slackapi/slack-github-action@v1.23.0
# with:
# channel-id: ${{ vars.SLACK_BOT_CHANNEL_TEST }}
# # payload: |
# # {
# # "text": "${{ github.workflow }}: Daily CI: '**${{ matrix.module-factor }} (CPU)** for **Python-${{ matrix.python-version }}**>: *Failed tests!*"
# # }
# payload: |
# {
# "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 }}: **${{ matrix.module-factor }} (CPU)** for **Python-${{ matrix.python-version }}**>: *Failed tests!*"
# }
# }
# ]
# }
4 changes: 2 additions & 2 deletions .github/workflows/test-cartesian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:
branches:
- main
paths-ignore: # Skip if only gt4py.next and irrelevant doc files have been updated
paths-ignore: # Skip when only gt4py.next or doc files have been updated
- "src/gt4py/next/**"
- "tests/next_tests/**"
- "examples/**"
Expand Down Expand Up @@ -52,4 +52,4 @@ jobs:
env:
NUM_PROCESSES: auto
shell: bash
run: uv run nox -s 'cartesian_tests-${{ matrix.python-version }}(${{ matrix.codegen-factor }}, cpu)'
run: uv run nox -s 'test_cartesian-${{ matrix.python-version }}(${{ matrix.codegen-factor }}, cpu)'
44 changes: 44 additions & 0 deletions .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Test Jupyter Notebooks"

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test-notebooks:
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10", "3.11"]
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

- name: Install C++ libraries
if: ${{ matrix.os == 'ubuntu-latest' }}
shell: bash
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 }}

- name: Run 'docs' nox session
env:
NUM_PROCESSES: auto
shell: bash
run: uv run nox -s 'test_docs-${{ matrix.python-version }}'
2 changes: 1 addition & 1 deletion .github/workflows/test-eve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
env:
NUM_PROCESSES: auto
shell: bash
run: uv run nox -s eve_tests-${{ matrix.python-version }}
run: uv run nox -s test_eve-${{ matrix.python-version }}
4 changes: 2 additions & 2 deletions .github/workflows/test-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:
branches:
- main
paths-ignore: # Skip if only gt4py.cartesian and irrelevant doc files have been updated
paths-ignore: # Skip when only gt4py.cartesian or doc files have been updated
- "src/gt4py/cartesian/**"
- "tests/cartesian_tests/**"
- "examples/**"
Expand Down Expand Up @@ -49,4 +49,4 @@ jobs:
env:
NUM_PROCESSES: auto
shell: bash
run: uv run nox -s 'next_tests-${{ matrix.python-version }}(${{ matrix.codegen-factor }}, cpu, ${{ matrix.mesh-factor }})'
run: uv run nox -s 'test_next-${{ matrix.python-version }}(${{ matrix.codegen-factor }}, cpu, ${{ matrix.mesh-factor }})'
42 changes: 0 additions & 42 deletions .github/workflows/test-notebooks.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test-storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ jobs:
env:
NUM_PROCESSES: auto
shell: bash
run: uv run nox -s 'storage_tests-${{ matrix.python-version }}(cpu)'
run: uv run nox -s 'test_storage-${{ matrix.python-version }}(cpu)'
Loading

0 comments on commit 65d09f1

Please sign in to comment.