-
Notifications
You must be signed in to change notification settings - Fork 86
156 lines (126 loc) · 5.14 KB
/
build.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Haskell CI
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
pull_request:
merge_group:
push:
branches:
- "release/*"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ghc: ["8.10.7", "9.6", "9.8", "9.10"]
os: [windows-latest]
env:
# Modify this value to "invalidate" all cabal caches.
CABAL_CACHE_VERSION: "2024-05-22"
# Modify this value to "invalidate" the cabal store cache only.
CACHE_VERSION: "20220919"
# Modify this value to "invalidate" the dist-newstyle cache only.
DIST_CACHE_VERSION: "20221122"
steps:
- name: Install Haskell
uses: input-output-hk/actions/haskell@latest
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: "3.10.3.0"
pacman-packages: >
mingw-w64-x86_64-pkg-config
mingw-w64-x86_64-openssl
mingw-w64-x86_64-sed
base-devel
autoconf-wrapper
autoconf
automake
libtool
make
- uses: actions/checkout@v4
- name: "Configure cabal.project.local"
run: |
cp scripts/ci/cabal.project.local.${{ runner.os }} cabal.project.local
- name: Update PATH
if: runner.os == 'Windows'
run: |
$env:PATH=("C:\msys64\mingw64\bin;{0}" -f $env:PATH)
echo "PATH=$env:PATH" >> $env:GITHUB_ENV
- name: Update Hackage and CHaP
run: cabal update
- name: Record dependencies
id: record-deps
run: |
cabal build all --dry-run
cat dist-newstyle/cache/plan.json | jq -L .github/workflows/jq-install-plan | sort | uniq > dependencies.txt
- uses: actions/cache/restore@v4
name: "Restore cache: `cabal store`"
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: cache-dependencies-${{ env.CABAL_CACHE_VERSION }}-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
restore-keys: cache-dependencies-${{ env.CABAL_CACHE_VERSION }}-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}
enableCrossOsArchive: true
- uses: actions/cache@v4
name: "Cache `dist-newstyle`"
with:
path: |
dist-newstyle
!dist-newstyle/**/.git
key: cache-dist-${{ env.CABAL_CACHE_VERSION }}-${{ env.DIST_CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project') }}
restore-keys: cache-dist-${{ env.CABAL_CACHE_VERSION }}-${{ env.DIST_CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}
- name: Build dependencies
run: cabal build --only-dependencies all -j
- uses: actions/cache/save@v4
name: "Save cache: `cabal store`"
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: cache-dependencies-${{ env.CABAL_CACHE_VERSION }}-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
enableCrossOsArchive: true
- name: Build projects [build]
run: cabal build all -j
# Test network packages
- name: ntp-client [test]
run: cabal run ntp-client:test -- +RTS -maxN2 -RTS
- name: monoidal-synchronisation [test]
run: cabal run monoidal-synchronisation:test -- +RTS -maxN2 -RTS
- name: network-mux [test]
# TODO: issue #4635 to enable `+RTS -N`
run: cabal run network-mux:test
- name: ourobors-network-testing [test]
run: cabal run ouroboros-network-testing:test -- +RTS -maxN2 -RTS
- name: ourobors-network-framework [io-tests]
# TODO: enable `+RTS -N`
run: cabal run ouroboros-network-framework:io-tests
- name: ourobors-network-framework [sim-tests]
if: runner.os != 'Windows'
run: cabal run ouroboros-network-framework:sim-tests -- +RTS -maxN2 -RTS
# TODO: run CDDL
- name: ouroboros-network-protocols [test]
run: cabal run ouroboros-network-protocols:test -- +RTS -maxN2 -RTS
# We don't run cddl in GitHub actions (only on Hydra).
# - name: ouroboros-network-protocols [cddl]
# run: cabal run ouroboros-network-protocols-test:cddl
- name: ouroboros-network [io-tests]
run: cabal run ouroboros-network:io-tests -- +RTS -maxN2 -RTS
- name: ouroboros-network [sim-tests]
if: runner.os != 'Windows'
run: cabal run ouroboros-network:sim-tests -- +RTS -maxN2 -RTS
# Uncomment the following back in for debugging. Remember to launch a `pwsh` from
# the tmux session to debug `pwsh` issues. And be reminded that the `/msys2` and
# `/msys2/mingw64` paths are not in PATH by default for the workflow, but tmate
# will put them in.
# You may also want to run
#
# $env:PATH=("C:\Program Files\PowerShell\7;{0}" -f $env:ORIGINAL_PATH)
#
# to restore the original path. Do note that some test might need msys2
# and will silently fail if msys2 is not in path. See the "Run tests" step.
#
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: true