Skip to content

Test data sources

Test data sources #602

Workflow file for this run

name: Test data sources
on:
push:
branches: [ main ]
# Uncomment to test changes on a PR branch
# pull_request:
# branches: [ main ]
schedule: # 05:00 UTC = 06:00 CET = 07:00 CEST
- cron: "0 5 * * *"
# Cancel previous runs that have not completed
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
source:
runs-on: ubuntu-latest
strategy:
matrix:
source:
- ABS
- ABS_JSON
- BBK
- BIS
- COMP
- ECB
- EMPL
- ESTAT
- ESTAT3
- ESTAT_COMEXT
- GROW
- ILO
- IMF
- INEGI
- INSEE
- ISTAT
- LSD
- NB
- NBB
- OECD
- OECD_JSON
- SGR
- SPC
- STAT_EE
- UNESCO
- UNICEF
- UNSD
- WB
- WB_WDI
name: ${{ matrix.source }}
steps:
- uses: actions/checkout@v4
# TODO avoid requiring this; it's not used in this workflow
- name: Checkout test data
uses: actions/checkout@v4
with:
repository: khaeru/sdmx-test-data
path: sdmx-test-data
- uses: actions/setup-python@v5
with:
python-version: 3.x
cache: pip
cache-dependency-path: "**/pyproject.toml"
- name: Install the Python package and dependencies
run: pip install .[cache,tests] pytest-regex
- name: Tests of ${{ matrix.source }} data source
continue-on-error: true
env:
SDMX_TEST_DATA: ./sdmx-test-data/
run: |
pytest -m network --regex '.*Test${{ matrix.source }}:' \
--color=yes --durations=30 -rA --verbose \
--cov-report=xml \
--numprocesses=auto
- name: Upload ${{ matrix.source }} results as a build artifact
uses: actions/upload-artifact@v4
with:
name: source-tests-${{ matrix.source }}
path: source-tests/*.json
compression-level: 1
- name: Upload test coverage to Codecov.io
uses: codecov/codecov-action@v4
with: { token: "${{ secrets.CODECOV_TOKEN }}" }
collect:
needs: source
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
cache: pip
cache-dependency-path: "**/pyproject.toml"
- name: Install the Python package and dependencies
run: pip install .[cache,tests]
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: source-tests
pattern: source-tests-*
merge-multiple: true
- name: Compile report
run: python -m sdmx.testing.report
- name: Upload report as a pages artifact
uses: actions/upload-pages-artifact@v3
with: { path: source-tests }
# This job is as described at https://github.com/actions/deploy-pages
deploy:
needs: collect
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
# Specify runner + deployment step
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
# Deploy to the gh-pages environment
environment:
name: gh-pages
url: ${{ steps.deployment.outputs.page_url }}