-
Notifications
You must be signed in to change notification settings - Fork 12
140 lines (119 loc) · 3.99 KB
/
hvega-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
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
# Based on https://kodimensional.dev/github-actions but all bugs are mine.
# Mine, I tell ya.
#
# Use https://raw.githubusercontent.com/kowainik/.github/main/workflow-templates/ci.yml
# as the basis.
#
# I am hoping to adjust this to support "multiple" repositories in the
# same account (or, at least, just run hvega through CI). It would be
# nice to only run hvega changes for hvega-related changes, but given the
# set up how would you automate that?
#
name: hvega-CI
# Trigger the workflow on push or pull request, but only for the main branch
on:
pull_request:
push:
branches: [main]
jobs:
cabal:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
cabal: ["latest"]
os: [ubuntu-latest]
ghc-version: ["9.6", "9.4", "9.2", "9.0", "8.10"]
include:
- os: macOS-latest
ghc-version: '9.4'
- os: windows-latest
ghc-version: '9.4'
steps:
- uses: actions/checkout@v3
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'
- uses: haskell/actions/setup@v2
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Configure
working-directory: ./hvega
run: |
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
- name: Freeze
working-directory: ./hvega
run: |
cabal freeze
- uses: actions/[email protected]
name: Cache ~/.cabal/store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
- name: Install dependencies
working-directory: ./hvega
run: |
cabal build all --only-dependencies
- name: Build
working-directory: ./hvega
run: |
cabal build all
- name: List - non Windows
working-directory: ./hvega
shell: bash
run: |
if [ "$RUNNER_OS" != "Windows" ]; then
egrep 'any.aeson|any.base|any.bytestring|any.containers|any.filepath|any.tasty|any.text|any.unordered-containers' ../cabal.project.freeze
fi
- name: Test
working-directory: ./hvega
run: |
cabal test all
# test the hvega/stack.yaml setup (so need to keep the versions up to date)
stack:
name: stack / ghc ${{ matrix.ghc }}
runs-on: ubuntu-latest
strategy:
matrix:
stack: ["latest"]
ghc: ["9.4"]
steps:
- uses: actions/checkout@v3
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'
- uses: haskell/actions/setup@v2
name: Setup Haskell Stack
with:
ghc-version: ${{ matrix.ghc }}
enable-stack: true
stack-version: ${{ matrix.stack }}
- uses: actions/[email protected]
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-stack
- name: Install dependencies
working-directory: ./hvega
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
- name: Build
working-directory: ./hvega
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
- name: List
working-directory: ./hvega
run: |
stack list aeson
stack list aeson-pretty
stack list base
stack list bytestring
stack list containers
stack list filepath
stack list tasty
stack list tasty-golden
stack list text
stack list unordered-containers
- name: Test
working-directory: ./hvega
run: |
stack test --system-ghc