Merge pull request #185 from swamp-agr/main #215
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-12] | |
steps: | |
- name: 📥 Checkout repository | |
uses: actions/checkout@v4 | |
- name: 🧰 Setup Stack | |
uses: freckle/stack-action@v5 | |
- name: Tar and strip the binary | |
run: | | |
mkdir -p bin/ | |
cp $(stack exec -- which rzk) bin/. | |
tar -cvzf rzk-bin.tar.gz bin/ | |
shell: bash | |
- name: Upload rzk binary as Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: rzk-bin.tar.gz | |
name: rzk-${{ runner.os }}-${{ runner.arch }}.tar.gz | |
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@v4 | |
- name: 🧰 Setup Stack | |
uses: freckle/stack-action@v5 | |
- 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@v4 | |
- name: 📥 Download rzk | |
id: download | |
uses: actions/download-artifact@v4 | |
with: | |
name: rzk-${{ runner.os }}-${{ runner.arch }}.tar.gz | |
- 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 |