Merge pull request #2 from EvmosGov/master #13
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 | |
on: | |
push: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Benchmark | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Cache yarn dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Run Benchmarks | |
run: yarn benchmark:debug | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: bench-logs | |
path: logs/ | |
download_artifact: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: Download Build Artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: bench-logs | |
path: logs/ | |
- name: Commit and push if changed | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
git add -A | |
git diff --quiet && git diff --staged --quiet || git commit -m "Update benchmark logs" | |
git push origin HEAD:master --follow-tags --force | |
env: | |
GH_PAT: ${{ secrets.GH_PAT }} |