Skip to content

Commit

Permalink
Add rzk checks to GHC workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fizruk committed Oct 1, 2023
1 parent 03e0f32 commit e792071
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 2 deletions.
53 changes: 51 additions & 2 deletions .github/workflows/ghc.yml
Expand Up @@ -3,8 +3,26 @@ 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:
Expand All @@ -13,9 +31,11 @@ permissions:
contents: write

jobs:
build-and-test:
build:
name: "Build and test with GHC"
runs-on: ubuntu-latest
outputs:
rzkPath: ${{ steps.rzkBinary.outputs.rzkPath }}

steps:
- name: 📥 Checkout repository
Expand All @@ -34,8 +54,19 @@ jobs:
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: ${{ steps.rzkBinary.outputs.rzkPath }}
if-no-files-found: error

haddock:
needs: [build-and-test]
needs: [build]
if: ${{ github.ref_name == 'develop' }}
name: "Build and upload Haddock documentation (develop)"
runs-on: ubuntu-latest
Expand All @@ -62,3 +93,21 @@ jobs:
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
1 change: 1 addition & 0 deletions .github/workflows/ghcjs.yml
Expand Up @@ -14,6 +14,7 @@ on:
pull_request:
branches: [develop]
paths:
- .github/workflows/ghcjs.yml
- rzk/**
- rzk-js/**
- rzk-playground/**
Expand Down

0 comments on commit e792071

Please sign in to comment.