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 to GHC 9.6, latest Stackage Nightly, and use BNFC in setup #116

Merged
merged 17 commits into from Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
@@ -0,0 +1,3 @@
rzk/grammar/Syntax.cf linguist-language=grammar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see grammar as a language identifier in languages.yml. Perhaps it should be ABNF or EBNF? Note that either would also require linguist-detectable since they have type: data

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use EBNF, thanks!

rzk/src/Language/Rzk/Syntax/* linguist-generated=true
docs/** linguist-documentation
68 changes: 0 additions & 68 deletions .github/workflows/binaries.yml

This file was deleted.

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

This file was deleted.

113 changes: 113 additions & 0 deletions .github/workflows/ghc.yml
@@ -0,0 +1,113 @@
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
outputs:
rzkPath: ${{ steps.rzkBinary.outputs.rzkPath }}

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

- name: 🧰 Setup Stack
uses: freckle/stack-action@v4
with:
cache-prefix: ${{ runner.os }}-stack-

- name: 🔨 Build dependencies (with Stack)
run: |
stack build --only-dependencies

- name: 🔨 Build and test (with Stack)
run: |
stack test

- name: Tar and strip the binary
id: rzkBinary
run: echo "rzkPath=$(stack exec -- which rzk)" >> "$GITHUB_OUTPUT"

- name: Upload rzk binary as Artifact
uses: actions/upload-artifact@v3
with:
path: ${{ steps.rzkBinary.outputs.rzkPath }}
name: "rzk-${{ github.ref_name }}"
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
with:
cache-prefix: ${{ runner.os }}-stack-

- 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
uses: actions/download-artifact@v3
with:
name: ${{ needs.build.outputs.rzkPath }}

- name: Check Rzk files
run: ./rzk typecheck docs/docs/examples/recId.rzk.md # FIXME: rely on rzk.yaml instead
shell: bash
11 changes: 6 additions & 5 deletions .github/workflows/ghcjs.yml
@@ -1,4 +1,4 @@
name: Build with GHCJS and Deploy to GitHub Pages
name: GHCJS (build and deploy Rzk playground)

on:
push:
Expand All @@ -10,23 +10,24 @@ on:
- rzk-js/**
- rzk-playground/**
- stack.yaml
- '**/*.nix'
- "**/*.nix"
pull_request:
branches: [main, develop]
branches: [develop]
paths:
- .github/workflows/ghcjs.yml
- rzk/**
- rzk-js/**
- rzk-playground/**
- stack.yaml
- '**/*.nix'
- "**/*.nix"

workflow_dispatch: # allow triggering this workflow manually

permissions:
contents: write

jobs:
build-and-deploy:
build-and-deploy-with-ghcjs:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repository
Expand Down
57 changes: 0 additions & 57 deletions .github/workflows/hackage.yml

This file was deleted.

65 changes: 0 additions & 65 deletions .github/workflows/haddock.yml

This file was deleted.