Skip to content

Add touchstone relative benchmarking #6

Add touchstone relative benchmarking

Add touchstone relative benchmarking #6

# Modified to follow workflow in EpiNow2
name: Continuous Benchmarks (Receive)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
on:
pull_request:
paths:
# Where model code is defined: R/, src/, inst/include/
- "inst/include/**"
- "src/**"
- "R/**"
# Benchmarking code, config file, and manual trigger
- "touchstone/**"
- ".github/workflows/touchstone-*.yaml"
- ".benchmark"
jobs:
prepare:
runs-on: ubuntu-latest
# Allow benchmarking workflow to run for external contribs
outputs:
config: ${{ steps.read_touchstone_config.outputs.config }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- id: read_touchstone_config
run: |
content=`cat ./touchstone/config.json`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=config::$content"
build:
needs: prepare
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- ${{ fromJson(needs.prepare.outputs.config) }}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: lorenzwalthert/touchstone/actions/receive@v1
with:
cache-version: 1
benchmarking_repo: ${{ matrix.config.benchmarking_repo }}
benchmarking_ref: ${{ matrix.config.benchmarking_ref }}
benchmarking_path: ${{ matrix.config.benchmarking_path }}