diff --git a/.github/workflows/ghc.yml b/.github/workflows/ghc.yml index 7676c4589..a7c9052e6 100644 --- a/.github/workflows/ghc.yml +++ b/.github/workflows/ghc.yml @@ -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: @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/ghcjs.yml b/.github/workflows/ghcjs.yml index ee1694700..2416d7607 100644 --- a/.github/workflows/ghcjs.yml +++ b/.github/workflows/ghcjs.yml @@ -14,6 +14,7 @@ on: pull_request: branches: [develop] paths: + - .github/workflows/ghcjs.yml - rzk/** - rzk-js/** - rzk-playground/**