Create test data asset #373
This file contains hidden or 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: Build and Test | |
| env: | |
| ZENODO_RECORD_ID: 17423608 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| paths-ignore: | |
| - "**.md" | |
| - "**.rst" | |
| - "**.ipynb" | |
| branches: | |
| - main | |
| - develop | |
| jobs: | |
| constants: | |
| name: Set constants | |
| runs-on: ubuntu-latest | |
| outputs: | |
| ZENODO_RECORD_ID: ${{ steps.output_env.outputs.ZENODO_RECORD_ID }} | |
| steps: | |
| - id: output_env | |
| run: echo "ZENODO_RECORD_ID=${{ env.ZENODO_RECORD_ID }}" >> $GITHUB_OUTPUT | |
| prepare_test_data: | |
| name: Prepare test data | |
| needs: constants | |
| uses: ./.github/workflows/prepare_test_data.yml | |
| secrets: inherit | |
| with: | |
| zenodo_record_id: ${{ needs.constants.outputs.ZENODO_RECORD_ID }} | |
| test_and_build: | |
| needs: prepare_test_data | |
| if: github.event.pull_request.draft == false | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["ubuntu-latest"] | |
| python-version: ["3.10"] | |
| name: Test and build for ${{ matrix.python-version }}, ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/install_eitprocessing | |
| with: | |
| dependencies: testing | |
| python-version: ${{ matrix.python-version }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download test data archive from release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release download testdata_zenodo.${{ env.ZENODO_RECORD_ID }} --pattern "test_data.tar.zst" | |
| - name: Extract test data | |
| run: | | |
| tar -x -f test_data.tar.zst | |
| rm test_data.tar.zst | |
| - name: Run pytest | |
| run: pytest -v |