Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update flake and playground #84

Merged
merged 29 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
39f0b2f
add: rzk-playground
deemp Sep 25, 2023
b5a1b02
move: try-rzk -> rzk-js
deemp Sep 25, 2023
ef31534
fix: update hs code for ghc 9.6.2
deemp Sep 25, 2023
85ee750
fix: update flake, refactor, add scripts
deemp Sep 25, 2023
eb8f054
fix: package name try-rzk -> rzk-js
deemp Sep 25, 2023
1d48d54
fix: make direnv work without flakes
deemp Sep 25, 2023
205622d
fix: update paths and scripts in the ghcjs action
deemp Sep 25, 2023
ef2408e
add: gitignore artifacts
deemp Sep 25, 2023
143808f
add: hls hie config
deemp Sep 25, 2023
54a9c18
fix: format README, update development instructions
deemp Sep 25, 2023
91a5302
fix: create parent dir for rzk.js
deemp Sep 25, 2023
bd99bf4
fix: scrolling
deemp Sep 25, 2023
4809cfa
fix: scrollable area
deemp Sep 26, 2023
1845417
fix: use monokai colors
deemp Sep 26, 2023
c8f8c6c
add: rzk grammar for CodeMirror
deemp Sep 26, 2023
f9a97ca
fix: make it build
deemp Sep 27, 2023
8d974bb
fix: skip newline
deemp Sep 27, 2023
2fe3a1c
fix: parsing
deemp Sep 30, 2023
973cef3
add: highlighting
deemp Sep 30, 2023
208a70a
move: usual.nix -> default.nix
deemp Sep 30, 2023
a837532
Merge remote-tracking branch 'upstream/develop' into develop
deemp Sep 30, 2023
66fe61e
fix: don't clean playground directory on non-main
deemp Sep 30, 2023
865ef6f
fix: use patched lezer-generator
deemp Sep 30, 2023
1ed093b
fix: remove versions upper bounds
deemp Sep 30, 2023
88d33bc
fix: import
deemp Sep 30, 2023
5e8a77d
fix: update package.lock
deemp Sep 30, 2023
1cd0126
Merge remote-tracking branch 'upstream/develop' into develop
deemp Oct 1, 2023
3291cd0
fix: import 'when'
deemp Oct 1, 2023
c665828
fix: stack setup and caching
deemp Oct 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
11 changes: 2 additions & 9 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,9 @@ jobs:
uses: actions/checkout@v3

- name: 🧰 Setup Stack
uses: haskell/actions/setup@v1
uses: freckle/stack-action@v4
with:
enable-stack: true

- name: 💾 Cache .stack/
uses: actions/cache@v2
with:
path: |
.stack
key: ${{ runner.os }}-${{ hashFiles('stack.yaml.lock', 'rzk.cabal') }}-stack
cache-prefix: ${{ runner.os }}-stack-

- name: 🔨 Install BNFC, alex and happy (with Stack)
run: |
Expand Down
54 changes: 37 additions & 17 deletions .github/workflows/ghcjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ on:
paths:
- .github/workflows/ghcjs.yml
- rzk/**
- try-rzk/**
- rzk-js/**
- rzk-playground/**
- stack.yaml
- '**/*.nix'
pull_request:
branches: [main, develop]
paths:
- rzk/**
- try-rzk/**
- rzk-js/**
- rzk-playground/**
- stack.yaml
- '**/*.nix'

workflow_dispatch: # allow triggering this workflow manually

Expand All @@ -28,44 +32,60 @@ jobs:
- 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 +95,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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ __pycache__
*.fdb_latexmk
*.fls
*.log
rzk/doc/
rzk/doc/
/rzk-playground-release
Loading