Skip to content

Merge pull request #610 from tweag/update-wasm-grammars #1445

Merge pull request #610 from tweag/update-wasm-grammars

Merge pull request #610 from tweag/update-wasm-grammars #1445

Workflow file for this run

on: push
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Install Nix
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Set up Nix cache
uses: cachix/cachix-action@v12
with:
name: tweag-topiary
authToken: "${{ secrets.CACHIX_TWEAG_TOPIARY_AUTH_TOKEN }}"
- name: Set up frontend cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: node_modules-${{ hashFiles('**/package-lock.json')}}
- name: Clippy, test, and benchmark
run: export GC_DONT_GC=1; nix -L flake check
- name: Build and test executable
run: 'echo \{ \"foo\": \"bar\" \} | nix run . -- fmt -l json'
- name: Verify that usage in README.md matches CLI output
run: ./verify-documented-usage.sh
- name: Build web playground Wasm app
if: success() && matrix.os == 'ubuntu-latest'
run: nix build .#topiary-playground
- name: Copy web playground Wasm app into playground frontend
if: success() && matrix.os == 'ubuntu-latest'
run: |
mkdir -p web-playground/src/wasm-app
cp -r result/* web-playground/src/wasm-app/
- name: Move sample input and queries into playground frontend
if: success() && matrix.os == 'ubuntu-latest'
run: |
mkdir -p web-playground/src/samples
mv web-playground/src/wasm-app/languages_export.ts web-playground/src/samples/
- name: Install web playground frontend dependencies
if: success() && matrix.os == 'ubuntu-latest'
run: npm install --prefix web-playground
- name: Start web playground frontend
if: success() && matrix.os == 'ubuntu-latest'
run: |
npm run dev --prefix web-playground &
# Loop until there's a response
while [[ "$(curl --silent --output /dev/null --write-out "%{http_code}" http://localhost:5173/playground)" != "200" ]]; do
sleep 2
done
- name: Test web playground frontend
if: success() && matrix.os == 'ubuntu-latest'
run: npm run e2e --prefix web-playground
- name: Make web playground frontend release build
if: success() && matrix.os == 'ubuntu-latest'
run: npm run build --prefix web-playground
- name: Copy playground into website
if: success() && matrix.os == 'ubuntu-latest'
run: |
rm -rf website/playground
cp -r web-playground/dist website/playground
- name: Upload GitHub Pages artifact
uses: actions/[email protected]
if: success() && matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/main'
with:
path: 'website'
deploy:
needs: build
if: github.ref == 'refs/heads/main'
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1