From 17b364562d791a5c7f68e361170d876b2affe6e0 Mon Sep 17 00:00:00 2001 From: Rahul Date: Tue, 12 Dec 2023 14:34:33 +0530 Subject: [PATCH] Update workflow --- .github/workflows/main.yml | 93 ++++++++++++++++++++++++++++++-------- 1 file changed, 74 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 92b51e9..d93d99b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,22 +1,77 @@ +# This workflow inspired by the workflow at +# jonsterling/agda-calf on: [push] jobs: - typechecking: - runs-on: ubuntu-latest - name: Typechecking - steps: - - name: "Clone repository" - uses: actions/checkout@v2 - - name: Run Agda - id: typecheck - uses: ayberkt/agda-github-action@v3.4 - with: - main-file: index.agda - source-dir: src - unsafe: true - - name: Upload HTML - id: html-upload - uses: actions/upload-artifact@v1 - with: - name: html - path: html \ No newline at end of file + build: + runs-on: ubuntu-latest + timeout-minutes: 60 + + strategy: + matrix: + agda-ref: ["v2.6.3"] + ghc-ver: ["8.10.2"] + cabal-ver: ["3.4.0.0"] + cubical-ref: ["rahulc29/realizability"] + steps: + - uses: actions/cache@v2 + name: Cache cabal packages + id: cache-cabal + with: + path: | + ~/.cabal/packages + ~/.cabal/store + ~/.cabal/bin + ~/.local/bin + dist-newstyle + key: ${{ runner.os }}-${{ matrix.ghc-ver }}-${{ matrix.cabal-ver }}-${{ matrix.agda-ref }} + - name: Install cabal + if: steps.cache-cabal.outputs.cache != 'true' + uses: actions/setup-haskell@v1.1.3 + with: + ghc-version: ${{ matrix.ghc-ver }} + cabal-version: ${{ matrix.cabal-ver }} + - name: Put cabal binaries in PATH + run: echo "~/.cabal/bin" >> $GITHUB_PATH + - name: Download Agda from Github + if: steps.cache-cabal.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + repository: agda/agda + path: agda + ref: ${{ matrix.agda-ref }} + - name: Install Agda + if: steps.cache-cabal.outputs.cache-hit != 'true' + run: | + cabal update + cabal install --overwrite-policy=always --ghc-options='-O2 +RTS -M6G -RTS' alex-3.2.5 + cabal install --overwrite-policy=always --ghc-options='-O2 +RTS -M6G -RTS' happy-1.19.12 + cd agda + mkdir -p doc + touch doc/user-manual.pdf + cabal install --overwrite-policy=always --ghc-options='-O1 +RTS -M6G -RTS' + - name: Checkout realizability fork of Cubical + uses: actions/checkout@v2 + with: + repository: rahulc29/cubical + path: cubical + ref: ${{ matrix.cubical-ref }} + - name: Put cubical library in Agda library list + run: | + mkdir -p ~/.agda/ + touch ~/.agda/libraries + echo "$GITHUB_WORKSPACE/cubical/cubical.agda-lib" > ~/.agda/libraries + - name: Checkout master + uses: actions/checkout@v2 + with: + path: master + + - name: Compile main library + run: | + mkdir -p ~/main-build/_build + cp -f -R ~/main-build/_build $GITHUB_WORKSPACE/main/_build + rm -r ~/main-build + cd master + cd src + agda --html --html-dir=../docs index.agda + cp -f -R main/ ~/main-build/ \ No newline at end of file