Test data sources #695
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
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 | |
env: | |
python-version: 3.13 | |
jobs: | |
source: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
source: | |
- ABS | |
- ABS_JSON | |
- AR1 | |
- BBK | |
- BIS | |
- COMP | |
- ECB | |
- EMPL | |
- ESTAT | |
- ESTAT_COMEXT | |
- ESTAT3 | |
- GROW | |
- ILO | |
- IMF | |
- IMF_beta | |
- IMF_beta3 | |
- INEGI | |
- INSEE | |
- ISTAT | |
- LSD | |
- NB | |
- NBB | |
- OECD | |
- OECD_JSON | |
- SGR | |
- SPC | |
- STAT_EE | |
- StatCan | |
- TEST | |
- UNESCO | |
- UNICEF | |
- UNSD | |
- UY110 | |
- WB | |
- WB_WDI | |
name: ${{ matrix.source }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up uv, Python | |
uses: astral-sh/setup-uv@v5 | |
with: | |
cache-dependency-glob: "**/pyproject.toml" | |
python-version: ${{ env.python-version }} | |
- name: Install the package and dependencies | |
run: uv pip install .[tests] pytest-regex | |
- name: Tests of ${{ matrix.source }} data source | |
continue-on-error: true | |
run: | | |
uv run --no-sync \ | |
pytest -m network --regex '.*Test${{ matrix.source }}:' \ | |
--sdmx-fetch-data \ | |
--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@v5 | |
collect: | |
needs: source | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up uv, Python | |
uses: astral-sh/setup-uv@v5 | |
with: | |
cache-dependency-glob: "**/pyproject.toml" | |
python-version: ${{ env.python-version }} | |
- name: Install the package and dependencies | |
run: uv pip install .[tests] | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: source-tests | |
pattern: source-tests-* | |
merge-multiple: true | |
- name: Compile report | |
run: uv run --no-sync 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 }} |