Skip to content

Commit

Permalink
Merge branch 'release-v0.6.5'
Browse files Browse the repository at this point in the history
* release-v0.6.5: (58 commits)
  Bump version and update changelog
  Use rzk.yaml in a GitHub workflow
  Remove stack-8.6.5.yaml
  Update recId example (fix deprecation warnings and hints)
  Use rzk.yaml if it exists
  Update docs, add CONTRIBUTORS.md
  Support snippet/code param in Rzk playground
  Override BNFC-generated printTree with a more suitable one (avoid newlines for curly braces)
  Remove unnecessary output
  Remove unnecessary stack build steps
  Use .tar.gz for rzk binaries
  Fix path to extracted rzk binary
  Remove unnecessary stack steps, try download-artifact@v1
  Fix rzk job
  Update .gitattributes
  Make rzk artifact name valid
  Remove unnecessary cache option for Setup Stack
  Add rzk checks to GHC workflow
  Improve names of workflows
  Increase upper bound for Cabal
  ...
  • Loading branch information
fizruk committed Oct 1, 2023
2 parents d5611bc + 1ebbd29 commit 793417e
Show file tree
Hide file tree
Showing 90 changed files with 7,772 additions and 1,175 deletions.
11 changes: 9 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
use flake
eval "$shellHook"
if ! type "nix" > /dev/null; then
use nix -A default
eval "$shellHook"
use nix -A ghcjs
else
use flake .#default
eval "$shellHook"
use flake .#ghcjs
fi
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rzk/grammar/Syntax.cf linguist-language=EBNF linguist-detectable=true
rzk/src/Language/Rzk/Syntax/* linguist-generated=true
docs/** linguist-documentation=true
68 changes: 0 additions & 68 deletions .github/workflows/binaries.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/build-test.yml

This file was deleted.

106 changes: 106 additions & 0 deletions .github/workflows/ghc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: GHC (build, test, haddock)

# Controls when the workflow will run
on:
push:
branches: [main, develop]
tags: [v*]
paths:
- .github/workflows/ghcjs.yml
- rzk/**
- stack.yaml
- rzk.yaml
- "**/*.rzk.md"
- "**/*.rzk"
- "**/*.rzk.tex"
pull_request:
branches: [develop]
paths:
- .github/workflows/ghcjs.yml
- rzk/**
- stack.yaml
- rzk.yaml
- "**/*.rzk.md"
- "**/*.rzk"
- "**/*.rzk.tex"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: write

jobs:
build:
name: "Build and test with GHC"
runs-on: ubuntu-latest

steps:
- name: 📥 Checkout repository
uses: actions/checkout@v3

- name: 🧰 Setup Stack
uses: freckle/stack-action@v4

- name: Tar and strip the binary
run: |
mkdir -p bin/
cp $(stack exec -- which rzk) bin/.
tar -cvzf rzk-bin.tar.gz bin/
- name: Upload rzk binary as Artifact
uses: actions/upload-artifact@v3
with:
path: rzk-bin.tar.gz
name: rzk-bin
if-no-files-found: error

haddock:
needs: [build]
if: ${{ github.ref_name == 'develop' }}
name: "Build and upload Haddock documentation (develop)"
runs-on: ubuntu-latest

steps:
- name: 📥 Checkout repository
uses: actions/checkout@v3

- name: 🧰 Setup Stack
uses: freckle/stack-action@v4

- name: 🔨 Build Haddock Documentation (with Stack)
run: |
stack haddock
mkdir -p dist/haddock
mv $(stack path --local-doc-root)/* dist/haddock
- name: 🚀 Publish Haddock Documentation
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: dist/haddock
target-folder: haddock
single-commit: true

rzk:
needs: [build]
name: "Check Rzk formalizations"
runs-on: ubuntu-latest

steps:
- name: 📥 Checkout repository
uses: actions/checkout@v3

- name: 📥 Download rzk
id: download
uses: actions/download-artifact@v3
with:
name: rzk-bin

- name: Unpack rzk-bin.tar.gz
run: |
tar xzf ${{ steps.download.outputs.download-path}}/rzk-bin.tar.gz
- name: Check Rzk files
run: ./bin/rzk typecheck
shell: bash
62 changes: 42 additions & 20 deletions .github/workflows/ghcjs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build with GHCJS and Deploy to GitHub Pages
name: GHCJS (build and deploy Rzk playground)

on:
push:
Expand All @@ -7,65 +7,87 @@ on:
paths:
- .github/workflows/ghcjs.yml
- rzk/**
- try-rzk/**
- rzk-js/**
- rzk-playground/**
- stack.yaml
- "**/*.nix"
pull_request:
branches: [main, develop]
branches: [develop]
paths:
- .github/workflows/ghcjs.yml
- rzk/**
- try-rzk/**
- rzk-js/**
- rzk-playground/**
- stack.yaml
- "**/*.nix"

workflow_dispatch: # allow triggering this workflow manually

permissions:
contents: write

jobs:
build-and-deploy:
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: 🧰 Setup nix
- 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@v1
- 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') }}
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') }}
${{ 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
- name: 🔨 Build GHCJS version with Nix
run: |
nix build .#try-rzk || (nix log /nix/store/*-rzk-0.6.3.drv ; false)
# Uncomment to debug this job
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- name: 🔨 Collect build artifacts
- name: 🔨 Build Playground
env:
BASEPATH: /${{ github.event.repository.name }}/${{ github.ref_name }}/playground
run: |
mkdir -p dist/result/bin
cp -r result/bin/try-rzk.jsexe/ dist/result/bin/.
chmod -R +w dist/
cp try-rzk/index.html dist/.
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: dist
folder: rzk-playground-release
target-folder: ${{ github.ref_name }}/playground
clean: false
single-commit: true
Expand All @@ -75,7 +97,7 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: dist
folder: rzk-playground-release
target-folder: playground
clean: false
single-commit: true
Loading

0 comments on commit 793417e

Please sign in to comment.