-
Notifications
You must be signed in to change notification settings - Fork 11
156 lines (150 loc) · 4.65 KB
/
verify.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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Verify
on:
pull_request:
push:
jobs:
build-unix:
name: Build
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Check out
uses: actions/checkout@v3
- name: Get GHC version
id: ghc-version
run: echo "ghc-version=$(cat ghc.version)" >> "$GITHUB_OUTPUT"
- name: Set up Haskell
id: haskell-setup
uses: haskell/actions/setup@v2
with:
ghc-version: ${{ steps.ghc-version.outputs.ghc-version }}
enable-stack: true
stack-no-global: true
stack-setup-ghc: true
- name: Cache the Stack directory
uses: actions/cache@v3
with:
path: ${{ steps.haskell-setup.outputs.stack-root }}
key: v1-${{ matrix.os }}-stack-${{ hashFiles('stack.yaml', 'package.yaml') }}
- name: Install dependencies
run: stack --no-terminal install --only-dependencies --test --no-run-tests
- name: Build
run: stack --no-terminal install --test --no-run-tests --local-bin-path=./out/build/release
- name: Upload Smoke
uses: actions/upload-artifact@v3
with:
name: smoke-${{ matrix.os }}
path: out/build/release/smoke
- name: Run unit tests
run: stack --no-terminal test
spec-unix:
name: Spec
needs: build-unix
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Check out
uses: actions/checkout@v3
- name: Download Smoke
uses: actions/download-artifact@v3
with:
name: smoke-${{ matrix.os }}
- name: Make Smoke executable
run: chmod +x smoke
- name: Spec
run: ./smoke --command=./smoke spec
build-test-nix:
name: Build and Test with Nix
runs-on: ubuntu-20.04
steps:
- name: Check out
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v20
- name: Set up the Nix cache
uses: cachix/cachix-action@v12
with:
name: smoke
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build and Test
run: nix build --out-link ./out/build/nix
- name: Spec
run: ./out/build/nix/bin/smoke --command=./out/build/nix/bin/smoke spec
build-windows:
name: Build (windows-latest)
runs-on: windows-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Cache Stack
uses: actions/cache@v3
with:
path: C:\Users\runneradmin\AppData\Local\Programs\stack
key: v1-windows-latest-stack-${{ hashFiles('stack.yaml') }}
- name: Get GHC version
id: ghc-version
run: echo "ghc-version=$(Get-Content ghc.version)" >> "$Env:GITHUB_OUTPUT"
- name: Set up Haskell
id: haskell-setup
uses: haskell/actions/setup@v2
with:
ghc-version: ${{ steps.ghc-version.outputs.ghc-version }}
enable-stack: true
stack-no-global: true
stack-setup-ghc: true
- name: Cache the Stack root
uses: actions/cache@v3
with:
path: ${{ steps.haskell-setup.outputs.stack-root }}
key: v1-windows-latest-stack-root-${{ hashFiles('stack.yaml', 'package.yaml') }}
- name: Update MSYS2
run: |
stack --no-terminal exec -- pacman --noconfirm -Sy msys2-keyring
stack --no-terminal exec -- pacman --noconfirm -Syuu
- name: Build
run: 'stack --no-terminal install --test --no-run-tests --local-bin-path=.\out\build\release'
- name: Upload Smoke
uses: actions/upload-artifact@v3
with:
name: smoke-windows-latest
path: 'out\build\release\smoke.exe'
- name: Run unit tests
run: "stack --no-terminal test"
spec-windows:
name: Spec (windows-latest)
needs: build-windows
runs-on: windows-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Download Smoke
uses: actions/download-artifact@v3
with:
name: smoke-windows-latest
- name: Spec
run: '.\smoke.exe --command=.\smoke.exe spec'
lint:
name: Lint
needs: build-unix
runs-on: ubuntu-20.04
steps:
- name: Check out
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v20
- name: Set up the Nix cache
uses: cachix/cachix-action@v12
with:
name: samirtalwar
- name: Lint
run: nix develop .#lint --command make lint