From c723e092a692bdbf40db22c5a858773d23c9afe5 Mon Sep 17 00:00:00 2001 From: Alexander 'ccntrq' Pankoff Date: Thu, 24 Aug 2023 17:30:05 +0200 Subject: [PATCH] Add build workflow --- .github/workflows/build.yaml | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..6941078 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,51 @@ +name: build +on: + push: + pull_request: + +permissions: + contents: read + +jobs: + build: + name: ${{ matrix.ghc-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + ghc-version: ['9.2'] + + steps: + - uses: actions/checkout@v3 + + - name: Set up GHC ${{ matrix.ghc-version }} + uses: haskell-actions/setup@v2 + id: setup + with: + ghc-version: ${{ matrix.ghc-version }} + cabal-version: 'latest' + cabal-update: true + enable-stack: true + stack-version: 'latest' + + - name: Restore cached dependencies + uses: actions/cache@v3 + id: cache + env: + key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-stack-${{ steps.setup.outputs.stack-version }} + with: + path: | + ~/.stack + .stack-work + key: ${{ env.key}}-plan-${{ hashFiles('stack.yaml', 'package.yaml') }} + restore-keys: ${{ env.key }}- + + - name: Build + run: stack build + + - name: Build documentation + run: stack haddock + + - name: Package + run: stack sdist \ No newline at end of file