Skip to content

test workflow per dataset #8

test workflow per dataset

test workflow per dataset #8

name: Test Pie Dataset
on:
push:
branches: [main]
paths:
- "dataset_builders/pie/**"
- "data/datasets/**"
- "tests/dataset_builders/pie/**"
- "tests/fixtures/dataset_builders/pie/**"
- ".github/workflows/test_pie_datasets.yaml"
pull_request:
branches: [main, "release/*"]
paths:
- "dataset_builders/pie/**"
- "data/datasets/**"
- "tests/dataset_builders/pie/**"
- "tests/fixtures/dataset_builders/pie/**"
- ".github/workflows/test_pie_datasets.yaml"
jobs:
collect_datasets: # Job that list subdirectories
runs-on: ubuntu-latest
outputs:
datasets: ${{ steps.set-datasets.outputs.datasets }} # generate output name dir by using inner step output
steps:
- uses: actions/checkout@v2
- id: set-datasets # Give it an id to handle to get step outputs in the outputs key above
# Define step output named dir base on ls command transformed to JSON thanks to jq
run: |
DATASETS=$(ls dataset_builders/pie | jq -R -s -c 'split("\n")[:-1]')
echo "datasets=$DATASETS" >> "$GITHUB_OUTPUT"
dataset_builder:
runs-on: ubuntu-latest
needs: [ collect_datasets ] # Depends on previous job
strategy:
matrix:
dataset: ${{fromJson(needs.collect_datasets.outputs.datasets)}} # List matrix strategy from directories dynamically
steps:
- run: echo ${{matrix.dataset}}