Skip to content

[siibra-api] [10min] #108016

[siibra-api] [10min]

[siibra-api] [10min] #108016

Workflow file for this run

name: "[siibra-api] [10min]"
on:
schedule:
- cron: '*/10 * * * *'
env:
CSCS_ENDPOINT: https://siibra-api-stable.apps.hbp.eu
EBRAINS_ENDPOINT: https://siibra-api-prod.apps.tc.humanbrainproject.eu
jobs:
api-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
endpoint: [cscs]
use-cache: ["true", "false"]
version: ['v1', 'v2', 'v3']
include:
- endpoint: ebrains
version: "v3"
use-cache: "true"
env:
USE_CACHE: ${{ matrix.use-cache }}
outputs:
result-cscs-v1: ${{ steps.set-output.outputs.result-cscs-v1 }}
result-cscs-v2: ${{ steps.set-output.outputs.result-cscs-v2 }}
result-ebrains-v3: ${{ steps.set-output.outputs.result-ebrains-v3 }}
result-cscs-v3: ${{ steps.set-output.outputs.result-cscs-v3 }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install pytest requests nibabel
- name: "Set endpoint"
run: |
if [[ ${{ matrix.endpoint }} == "cscs" ]]
then
echo "SIIBRA_API_E2E_BASE_URL=${{ env.CSCS_ENDPOINT }}" >> $GITHUB_ENV
fi
if [[ ${{ matrix.endpoint }} == "ebrains" ]]
then
echo "SIIBRA_API_E2E_BASE_URL=${{ env.EBRAINS_ENDPOINT }}" >> $GITHUB_ENV
fi
- name: Run test
run: |
pytest ./siibra/api/${{ matrix.version }}
- if: success()
id: set-output
name: Success, set output
run: |
if [ ${{ matrix.use-cache }} == true ]
then
echo "result-${{ matrix.endpoint }}-${{ matrix.version }}=true" >> $GITHUB_OUTPUT
fi
report-to-uptime:
needs: api-test
runs-on: ubuntu-latest
if: always()
steps:
- name: Check outputs
run: |
cscs_v1=${{ needs.api-test.outputs.result-cscs-v1 }}
cscs_v2=${{ needs.api-test.outputs.result-cscs-v2 }}
ebrains_v3=${{ needs.api-test.outputs.result-ebrains-v3 }}
cscs_v3=${{ needs.api-test.outputs.result-cscs-v3 }}
echo "cscs_v1: $cscs_v1"
echo "cscs_v2: $cscs_v2"
echo "ebrains_v3: $ebrains_v3"
echo "cscs_v3: $cscs_v3"
if [ -z "$cscs_v1" ] || [ -z "$cscs_v2" ] || [ -z "$ebrains_v3" ] || [ -z "$cscs_v3" ]
then
exit -1
fi