diff --git a/.github/workflows/examples.yaml b/.github/workflows/examples.yaml new file mode 100644 index 00000000..815e1b79 --- /dev/null +++ b/.github/workflows/examples.yaml @@ -0,0 +1,37 @@ +name: Run examples + +on: + push: + branches: main + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build + run: cargo build --verbose + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: ixa-build-${{ github.run_id }} + path: . + + run_examples: + needs: build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + example: [basic-infection, births-deaths, load-people, network-hhmodel, parameter-loading, random, reports, reports-multi-threaded, runner, time-varying-infection] + steps: + - name: Download the artifact + uses: actions/download-artifact@v4 + with: + name: ixa-build-${{ github.run_id }} + - name: Run the example + run: cargo run --example ${{ matrix.example }}