-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (112 loc) · 3.76 KB
/
ci.yml
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
108
109
110
111
112
113
114
name: CI
# Trigger the workflow on push or pull request, but only for the main branch
on:
pull_request:
push:
branches: ["main"]
jobs:
check:
name: Linting and formatting
runs-on: ubuntu-latest
steps:
- name: Checkout base repo
uses: actions/[email protected]
- name: Set up Haskell
id: setup-haskell
uses: haskell/actions/setup@v1
with:
ghc-version: 8.10
cabal-version: latest
- name: Set up HLint
uses: haskell/actions/hlint-setup@v1
with:
version: 3.3.6
- name: Get Ormolu
run: curl -JLO 'https://github.com/tweag/ormolu/releases/download/0.4.0.0/ormolu-Linux.zip' && unzip 'ormolu-Linux.zip'
- name: Get cabal-fmt
uses: actions/[email protected]
with:
repository: phadej/cabal-fmt
path: ./cabal-fmt
ref: dc1e63bb10ddafd6152fae8f7206c3b201b0f7ab
- name: Configure cabal-fmt
working-directory: cabal-fmt
run: cabal new-configure -w ghc --disable-optimization
- name: Freeze
run: |
cd cabal-fmt
cabal new-freeze
- name: Cache
uses: actions/[email protected]
env:
V: 0
with:
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
./cabal-fmt/dist-newstyle
key: ${{ env.V }}-${{ hashFiles('./cabal-fmt/cabal.project.freeze') }}
restore-keys: ${{ env.V }}-
- name: Install cabal-fmt
working-directory: cabal-fmt
run: cabal new-install --install-method=copy --installdir=${{ runner.temp }} --overwrite-policy=always cabal-fmt
- name: Run HLint
uses: haskell/actions/hlint-run@v1
with:
path: src/
fail-on: 'suggestion'
- name: Run other checks
run: ./.github/check.sh ./ormolu ${{ runner.temp }}/cabal-fmt
native:
name: "Native: GHC ${{ matrix.ghc }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
ghc: ['8.10', '9.0', '9.2']
steps:
- name: Checkout base repo
uses: actions/[email protected]
- name: Set up Haskell
id: setup-haskell
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: 'latest'
- name: Configure
run: cabal new-configure --enable-tests
- name: Freeze
run: cabal freeze
- name: Cache
uses: actions/[email protected]
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
- name: Build
run: cabal build
emulated:
name: "Emulated: GHC ${{ matrix.ghc }} on ${{ matrix.arch }}"
runs-on: ubuntu-latest
strategy:
matrix:
arch: ['aarch64', 'armv7', 'i386']
ghc: ['8.10.7', '9.0.1', '9.2.1']
steps:
- name : Checkout base repo
uses: actions/[email protected]
- name: Build
uses: GarnetOS/[email protected]
with:
arch: ${{ matrix.arch }}
distro: 'bullseye'
githubToken: ${{ github.token }}
install: |
apt-get update -q -y
apt-get install -q -y curl libnuma-dev autotools-dev clang llvm-dev make libgmp-dev libtinfo5
curl -JL https://downloads.haskell.org/~ghcup/0.1.17.4/${{ matrix.arch }}-linux-ghcup-0.1.17.4 > ghcup
chmod +x ghcup
./ghcup -v install ghc --set ${{ matrix.ghc }}
./ghcup -v install cabal --set
run: |
~/.ghcup/bin/cabal update
~/.ghcup/bin/cabal build -w ~/.ghcup/bin/ghc