-
Notifications
You must be signed in to change notification settings - Fork 1
107 lines (101 loc) · 2.71 KB
/
ci.yml
File metadata and controls
107 lines (101 loc) · 2.71 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: CI
on:
pull_request:
push:
branches:
- main
workflow_call:
defaults:
run:
shell: bash -eu -o pipefail {0}
jobs:
build_and_test:
strategy:
matrix:
ghc_version:
- '9.8'
- '9.10'
- '9.12'
# - '9.14'
include:
- ghc_version: '9.8.1'
oldest: true
name: build_and_test (${{ matrix.ghc_version }})
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
-
id: setup
name: Set up GHC ${{ matrix.ghc_version }}
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc_version }}
-
name: Configure the build
run:
cabal configure
--enable-test
--test-show-details=streaming
-
if: ${{ matrix.oldest }}
name: Use oldest dependencies
run: cabal configure --enable-append --prefer-oldest
-
name: Get build plan
run: cabal build --dry-run
-
name: Get current month to clear cache
run: echo "CURR_MONTH=$(date +%B)" | tee -a "$GITHUB_ENV"
-
uses: actions/cache@v3
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ runner.os }}-cabal-cache-${{ env.CURR_MONTH }}-${{ matrix.ghc_version }}-${{ hashFiles('**/plan.json') }}
restore-keys: |
${{ runner.os }}-cabal-cache-${{ env.CURR_MONTH }}-${{ matrix.ghc_version }}-
-
name: Build + Test
run: cabal test
lint:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
-
name: Install hooky
run: |
curl -fsSL \
https://github.com/brandonchinn178/hooky/releases/download/v1.0.0/hooky-1.0.0-linux-x86_64 \
-o /usr/local/bin/hooky
chmod +x /usr/local/bin/hooky
-
name: Install dotslash
run: >
curl -fsSL https://github.com/facebook/dotslash/releases/latest/download/dotslash-ubuntu-22.04.$(uname -m).tar.gz
| tar xzf - -C /usr/local/bin/
-
name: Run hooky
run: hooky run --all --format=verbose
env:
SKIP: no_commit_to_branch
build_sdist:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
-
id: setup
name: Set up GHC
uses: haskell-actions/setup@v2
-
name: Strip unreleased section from CHANGELOG
run: sed -i -n '/^## Unreleased/d; /^## /,$p' CHANGELOG.md
-
name: Create sdist bundle
run: cabal sdist --output-directory=.
-
uses: actions/upload-artifact@v4
with:
name: kdl-sdist
path: kdl-*.tar.gz