From 20a928f74e40a8265fcc4ed8565cf09442412838 Mon Sep 17 00:00:00 2001 From: Wen Kokke Date: Wed, 1 Sep 2021 19:42:29 +0100 Subject: [PATCH] Wrote a more comprehensive Build action. --- .github/workflows/build.yml | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f6e5ee6a..1f64f290 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,11 +5,39 @@ name: Build jobs: build: runs-on: macOS-latest + strategy: matrix: ghc: ['8.10.5'] + steps: + - name: Get Gem Installation Directory + id: get-gemdir + run: | + echo "::set-output name=gemdir::$(gem env gemdir)" + shell: bash + + - name: Get Agda version + id: get-agda-version + run: | + echo "::set-output name=agda-version::$(cat plfa.cabal | sed -n -e 's/^.*Agda\s*==\(\S*\)\s*/\1/p')" + shell: bash + + - uses: actions/cache@v2 + name: Cache files + id: cache + with: + path: | + ~/.stack + ~/.local + ${{ steps.get-gemdir.outputs.gemdir }} + $GITHUB_WORKSPACE/.stack-work + $GITHUB_WORKSPACE/_build + $GITHUB_WORKSPACE/_cache + $GITHUB_WORKSPACE/_site + key: ${{ runner.os }}-${{ matrix.ghc }}-${{ steps.get-agda-version.outputs.agda-version }} + - name: Setup Haskell uses: haskell/actions/setup@v1 with: @@ -17,6 +45,9 @@ jobs: enable-stack: true stack-version: 'latest' + - name: Setup HTMLProofer + run: sudo gem install html-proofer + - name: Checkout uses: actions/checkout@v2 with: @@ -25,8 +56,5 @@ jobs: - name: Build website run: make build - - name: Install HTMLProofer - run: sudo gem install html-proofer - - name: Test website run: make test