-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (74 loc) · 2.18 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: CI
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
release:
types:
- prereleased
jobs:
build:
strategy:
matrix:
platform:
- ubuntu-latest
ghc_version:
- "8.6.5"
- "8.8.4"
- "8.10.7"
- "9.0.2"
- "9.2.8"
- "9.4.8"
- "9.6.3"
fail-fast: false
name: Build on Linux, GHC ${{ matrix.ghc_version }}
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc_version }}
cabal-version: "3.10.1.0"
- name: Cache
uses: actions/cache@v3
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-stack-${{ matrix.ghc_version }}
- name: cabal configure
run: cabal configure --with-ghc=ghc-${{ matrix.ghc_version }}
- name: Install dependencies
run: cabal build --dependencies-only --enable-tests --haddock-all
- name: cabal build
run: cabal build --ghc-options=-Werror
- run: cabal check
- run: cabal haddock
dist:
needs: build
runs-on: ubuntu-latest
name: Build source tarball
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
with:
cabal-version: "3.10.1.0"
- name: cabal sdist
run: |
cabal sdist --output-dir "$GITHUB_WORKSPACE/sdist"
echo "dist=$(find "$GITHUB_WORKSPACE/sdist" -maxdepth 1 -type f -name '*.tar.gz')" >> "$GITHUB_ENV"
- uses: actions/upload-artifact@v2
with:
name: Source tarball
path: ${{ env.dist }}
- uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.dist }}
tag: ${{ github.ref }}
- name: Upload tarball to hackage
run: |
curl -X POST 'https://hackage.haskell.org/packages/candidates/' -H "Authorization: X-ApiKey ${{ secrets.HACKAGE_KEY }}" -F "package=@$dist" -w '%{url_effective}\n'