BDD/Generator API #672
Workflow file for this run
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: 'benchmark (pull request)' | |
on: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
fetch-branch: | |
name: 'Fetch branch name' | |
runs-on: ubuntu-latest | |
steps: | |
- id: identify | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_HEAD_REF#refs/heads/})" | |
outputs: | |
branch: ${{ steps.identify.outputs.branch }} | |
fetch-remote: | |
name: 'Fetch remote' | |
runs-on: ubuntu-latest | |
steps: | |
- id: identify | |
run: | | |
echo "##[set-output name=remote;]$(if [ ${GITHUB_REPOSITORY} == 'SSoelvsten/adiar' ]; then echo 'origin'; else echo '${GITHUB_REPOSITORY}'; fi)" | |
outputs: | |
remote: ${{ steps.identify.outputs.remote }} | |
skip_duplicate: | |
name: 'Skip Job?' | |
continue-on-error: true | |
runs-on: ubuntu-latest | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@master | |
with: | |
paths: '["src/adiar/**"]' | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
run_benchmark: | |
name: 'Benchmark: ${{ matrix.N }}-Queens' | |
runs-on: ubuntu-latest | |
needs: [fetch-branch, fetch-remote, skip_duplicate] | |
if: ${{ needs.skip_duplicate.outputs.should_skip != 'true' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- N: '9' | |
- N: '12' | |
- N: '14' | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: 'Apt install' | |
run: | | |
sudo apt update | |
sudo apt install libboost-all-dev | |
- name: 'Run benchmark.py' | |
run: | | |
python3 ./.github/workflows/benchmark.py ${{ matrix.N }} origin main ${{ needs.fetch-remote.outputs.remote }} ${{ needs.fetch-branch.outputs.branch }} | |
- name: 'Post benchmark.out on PR' | |
if: always() | |
uses: machine-learning-apps/pr-comment@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
path: ./benchmark.out | |
run_dummy: | |
name: 'Benchmark: ${{ matrix.N }}-Queens' | |
runs-on: ubuntu-latest | |
needs: [skip_duplicate] | |
if: ${{ needs.skip_duplicate.outputs.should_skip == 'true' }} | |
strategy: | |
matrix: | |
include: | |
- N: '9' | |
- N: '12' | |
- N: '14' | |
steps: | |
- name: Echo skip | |
run: | | |
echo "Running benchmarks is skipped" | |