Merge pull request #4 from InstituteforDiseaseModeling/Agents.jl #12
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: Agents.jl | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
# deployments permission to deploy GitHub pages website | |
deployments: write | |
# contents permission to update benchmark contents in gh-pages branch | |
contents: write | |
jobs: | |
benchmark: | |
name: Run Agents.jl benchmark example | |
runs-on: ${{ matrix.os }} | |
if: "contains(github.event.head_commit.message, '\\build')" | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- '1' | |
os: | |
- ubuntu-latest | |
arch: | |
- x64 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: julia-actions/setup-julia@v1 | |
with: | |
version: ${{ matrix.version }} | |
arch: ${{ matrix.arch }} | |
- uses: actions/cache@v4 | |
env: | |
cache-name: cache-artifacts | |
with: | |
path: ~/.julia/artifacts | |
key: runner.os−test−env.cache−name−{{ hashFiles('**/Project.toml') }} | |
restore-keys: | | |
runner.os−test− | |
${{ env.cache-name }}- | |
${{ runner.os }}-test- | |
${{ runner.os }}- | |
- name: Run benchmark | |
run: | | |
cd examples/Agents.jl | |
julia --project --color=yes -e ' | |
using Pkg; | |
Pkg.instantiate(); | |
include("main.jl")' | |
# Download previous benchmark result from cache (if exists) | |
- name: Download previous benchmark data | |
uses: actions/cache@v4 | |
with: | |
path: ./cache | |
key: ${{ runner.os }}-benchmark | |
- name: Store benchmark result to cache | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
name: Agents.jl result | |
tool: 'julia' | |
output-file-path: examples/Agents.jl/output.json | |
external-data-json-path: ./cache/agents-data.json | |
# Use personal access token instead of GITHUB_TOKEN due to https://github.saobby.my.eu.orgmunity/t/github-action-not-triggering-gh-pages-upon-push/16096 | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
comment-on-alert: true | |
alert-comment-cc-users: '@krosenfeld-IDM' | |
# gh-pages branch is updated and pushed automatically with extracted benchmark data | |
- name: Store benchmark result to gh-pages | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
name: Agents.jl Benchmark | |
tool: 'julia' | |
output-file-path: examples/Agents.jl/output.json | |
# Access token to deploy GitHub Pages branch | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# Push and deploy GitHub pages branch automatically | |
auto-push: true |