Skip to content

Daily CI

Daily CI #667

Workflow file for this run

name: Daily CI
on:
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
## COMMENTED OUT: only for testing CI action changes
# pull_request:
# branches:
# - main
## END
jobs:
daily-ci:
strategy:
matrix:
python-version: ["3.8", "3.9", "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@v3
- 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
wget https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz
echo 7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca boost_1_76_0.tar.gz > boost_hash.txt
sha256sum -c boost_hash.txt
tar xzf boost_1_76_0.tar.gz
mkdir -p boost/include
mv boost_1_76_0/boost boost/include/
echo "BOOST_ROOT=${PWD}/boost" >> $GITHUB_ENV
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
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
env:
NUM_PROCESSES: auto
ENV_REQUIREMENTS_FILE: ${{ matrix.requirements-file }}
run: |
tox run --skip-missing-interpreters -m test-${{ matrix.tox-module-factor }}-cpu
- name: Notify slack
if: ${{ failure() }}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: slackapi/[email protected]
with:
channel-id: ${{ vars.SLACK_BOT_CHANNEL }}
payload: |
{
"text": "${{ github.workflow }}: `test-${{ matrix.tox-module-factor }}-cpu (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!*"
}
}
]
}