From 175268b422c20ec01bb0dc3d36a53a394931b289 Mon Sep 17 00:00:00 2001 From: Eugene Wissner Date: Wed, 24 Jun 2020 09:45:25 +0200 Subject: Add a github actions workflow --- .github/workflows/haskell.yml | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/haskell.yml (limited to '.github/workflows') diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml new file mode 100644 index 0000000..e2f4eac --- /dev/null +++ b/.github/workflows/haskell.yml @@ -0,0 +1,65 @@ +name: Haskell CI + +on: + push: ~ + pull_request: + branches: [master] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-haskell@v1 + with: + enable-stack: true + stack-no-global: true + stack-version: 'latest' + + - name: Cache + uses: actions/cache@v2 + with: + path: | + ~/.stack + graphql.cabal + stack.yaml.lock + key: ${{ runner.os }}-build-${{ hashFiles('**/stack.yaml') }} + restore-keys: '${{ runner.os }}-build-' + + - name: Install dependencies + run: stack --no-terminal test --only-snapshot + - name: Run tests + run: stack --no-terminal test --pedantic + - name: Build the documentation + run: | + stack --no-terminal ghc -- -Wall -Werror -fno-code docs/tutorial/tutorial.lhs + stack --no-terminal haddock --no-haddock-deps + + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-haskell@v1 + with: + enable-stack: true + stack-no-global: true + stack-version: 'latest' + + - name: Cache + uses: actions/cache@v2 + with: + path: | + ~/.stack + graphql.cabal + stack.yaml.lock + key: ${{ runner.os }}-build-${{ hashFiles('**/stack.yaml') }} + restore-keys: '${{ runner.os }}-build-' + + - name: Build HLint + run: stack --no-terminal build hlint + - name: Install HLint + run: stack --no-terminal install hlint + - name: Lint + run: stack --no-terminal exec hlint -- src tests docs -- cgit v1.2.3