Add categories #77
Workflow file for this run
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: Run AD tests and build website | |
on: | |
push: | |
branches: | |
- main | |
# If _any_ of the modified files match this filter, it will trigger this | |
# workflow | |
paths: | |
- '**/*.jl' | |
- '*.toml' | |
- 'ad.py' | |
- '.github/workflows/generate_website.yml' | |
pull_request: | |
paths: | |
- '**/*.jl' | |
- '*.toml' | |
- 'ad.py' | |
- '.github/workflows/generate_website.yml' | |
workflow_dispatch: | |
permissions: | |
actions: write | |
contents: write | |
jobs: | |
setup-keys: | |
runs-on: ubuntu-latest | |
outputs: | |
# Forward step outputs to job outputs | |
model_keys: ${{ steps.keys.outputs.model_keys }} | |
adtype_keys: ${{ steps.keys.outputs.adtype_keys }} | |
manifest: ${{ steps.keys.outputs.manifest }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: julia-actions/setup-julia@v2 | |
with: | |
version: "1" | |
- uses: julia-actions/cache@v2 | |
with: | |
cache-name: "ad" | |
- uses: julia-actions/julia-buildpkg@v1 | |
- uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: "3.13" | |
- name: Setup keys | |
id: keys | |
run: uv run ad.py setup | |
run-models: | |
runs-on: ubuntu-latest | |
needs: setup-keys | |
strategy: | |
matrix: | |
model: ${{ fromJSON(needs.setup-keys.outputs.model_keys) }} | |
outputs: | |
json: ${{ steps.output-matrix.outputs.json }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: julia-actions/setup-julia@v2 | |
with: | |
version: "1" | |
- uses: julia-actions/cache@v2 | |
with: | |
cache-name: "ad" | |
include-matrix: false | |
- uses: julia-actions/julia-buildpkg@v1 | |
- uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: "3.13" | |
- name: Run given model with all adtypes | |
id: run | |
run: uv run ad.py run --model ${{ matrix.model }} | |
env: | |
ADTYPE_KEYS: ${{ needs.setup-keys.outputs.adtype_keys }} | |
ADTESTS_MODELS_TO_LOAD: ${{ matrix.model }} | |
- name: Output matrix values | |
id: output-matrix | |
uses: penelopeysm/matrix-output@main | |
with: | |
yaml: | | |
model_name: ${{ matrix.model }} | |
results: ${{ steps.run.outputs.results }} | |
collect-results: | |
runs-on: ubuntu-latest | |
needs: [setup-keys, run-models] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: "3.13" | |
- run: uv run ad.py html | |
env: | |
RESULTS_JSON: ${{ needs.run-models.outputs.json }} | |
MANIFEST: ${{ needs.setup-keys.outputs.manifest }} | |
- name: Set up pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 10 | |
- name: Install dependencies | |
run: pnpm install | |
working-directory: web | |
- name: Build website | |
run: pnpm build --base ${{ github.event_name == 'pull_request' && '/ADTests/pr' || '/ADTests' }} | |
working-directory: web | |
- name: Upload results | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./web/dist | |
destination_dir: ${{ github.event_name == 'pull_request' && 'pr' || '' }} | |
keep_files: true |