ci: only deply bench on 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: Main Workflow | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
# TODO publish new version when tagged | |
test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
key: v1-${{ hashFiles('package-lock.json') }}-${{ hashFiles('elm.json', 'elm-tooling.json') }} | |
restore-keys: | | |
v1-${{ hashFiles('package-lock.json') }}- | |
v1- | |
path: | | |
node_modules | |
elm-stuff | |
benchmarks/elm-stuff | |
~/.elm | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- run: npm install | |
- run: npm test | |
- run: npx elm-format --validate src/ tests/ benchmarks/ | |
deploy-benchmark: | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
needs: test | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
key: v1-${{ hashFiles('package-lock.json') }}-${{ hashFiles('elm.json', 'elm-tooling.json') }} | |
restore-keys: | | |
v1-${{ hashFiles('package-lock.json') }}- | |
v1- | |
path: | | |
node_modules | |
elm-stuff | |
benchmarks/elm-stuff | |
~/.elm | |
- run: npm run generate-benchmark | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: "./docs" | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |