Stop typechecking after a parse error in some file (avoid invalid cache) #426
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: GHCJS (build and deploy Rzk playground) | |
on: | |
push: | |
branches: [main, develop] | |
tags: [v*] | |
paths: | |
- .github/workflows/ghcjs.yml | |
- rzk/** | |
- rzk-js/** | |
- rzk-playground/** | |
- stack.yaml | |
- "**/*.nix" | |
pull_request: | |
branches: [develop] | |
paths: | |
- .github/workflows/ghcjs.yml | |
- rzk/** | |
- rzk-js/** | |
- rzk-playground/** | |
- stack.yaml | |
- "**/*.nix" | |
workflow_dispatch: # allow triggering this workflow manually | |
permissions: | |
contents: write | |
jobs: | |
build-and-deploy-with-ghcjs: | |
name: "Build with GHCJS (and deploy Rzk playground)" | |
runs-on: ubuntu-latest | |
steps: | |
- name: 📥 Checkout repository | |
uses: actions/checkout@v3 | |
- name: ❄️ Install Nix | |
uses: nixbuild/nix-quick-install-action@v25 | |
with: | |
nix_conf: | | |
substituters = https://cache.nixos.org/ https://cache.iog.io https://nix-community.cachix.org https://miso-haskell.cachix.org | |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= miso-haskell.cachix.org-1:6N2DooyFlZOHUfJtAx1Q09H0P5XXYzoxxQYiwn6W1e8= | |
keep-outputs = true | |
- name: 👝 Restore and Cache Nix store | |
uses: nix-community/cache-nix-action@v4 | |
with: | |
key: ${{ runner.os }}-nix-${{ hashfiles('./flake.nix', './flake.lock', '.github/workflows/ghcjs.yml', './rzk/rzk.cabal') }} | |
restore-keys: | | |
${{ runner.os }}-nix-${{ hashfiles('./flake.nix', './flake.lock', '.github/workflows/ghcjs.yml', './rzk/rzk.cabal') }} | |
${{ runner.os }}-nix- | |
gc-linux: true | |
gc-max-store-size-linux: 7000000000 | |
purge: true | |
purge-created-max-age: 1209600 | |
- name: 👝 Restore and Cache NextJS cache | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-next-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-next- | |
path: | | |
~/.npm | |
rzk-playground/.next/cache | |
- name: 🔨 Remove lexer and parser generator files | |
run: | | |
rm -f rzk/src/Language/Rzk/Syntax/Lex.x | |
rm -f rzk/src/Language/Rzk/Syntax/Par.y | |
# Uncomment to debug this job | |
# - name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v3 | |
- name: 🔨 Build Playground | |
env: | |
ASSET_URL: /${{ github.event.repository.name }}/${{ github.ref_name }}/playground | |
run: | | |
nix run .#release-rzk-playground | |
- name: 🔨 Save flake from garbage collection | |
run: nix run .#save-flake | |
- name: '🚀 Publish JS "binaries" (${{ github.ref_name }})' | |
if: ${{ github.ref_name != 'main' && github.event_name == 'push' }} | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
folder: rzk-playground-release | |
target-folder: ${{ github.ref_name }}/playground | |
clean: false | |
single-commit: true | |
- name: '🚀 Publish JS "binaries" (latest)' | |
if: ${{ startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'v') && github.event_name == 'push' }} | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
folder: rzk-playground-release | |
target-folder: latest/playground | |
clean: false | |
single-commit: true | |
- name: '🚀 Publish JS "binaries"' | |
if: ${{ github.ref_name == 'main' && github.event_name == 'push' }} | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
folder: rzk-playground-release | |
target-folder: playground | |
clean: false | |
single-commit: true |