-
Notifications
You must be signed in to change notification settings - Fork 14
198 lines (174 loc) · 7.24 KB
/
debugger.yaml
File metadata and controls
198 lines (174 loc) · 7.24 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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
on:
push:
branches:
- master
pull_request: {}
workflow_call:
inputs:
use-haskell-debugger-view-from-hackage:
required: true
type: boolean
is-release:
required: true
type: boolean
env:
haskellDebuggerViewVersion: 0.2.1.0
haskellDebuggerVersion: 0.13.1.0
USE_HASKELL_DEBUGGER_VIEW_FROM_HACKAGE: ${{
github.event_name == 'workflow_call'
&& inputs.use-haskell-debugger-view-from-hackage
|| false
}}
name: Debugger CI
jobs:
build-vscode-extension:
name: Build VSCode Extension
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Build extension
run: |
cd vscode-extension/
nix-build
- name: Upload extension artifact
uses: actions/upload-artifact@v4
with:
name: Haskell Debugger Extension
path: vscode-extension/result/haskell-debugger-extension*.vsix
sdist-haskell-debugger:
name: Sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: haskell-actions/setup@v2
- name: Package hdb
run: cabal sdist
- name: Package haskell-debugger-view
run: cabal sdist haskell-debugger-view
- name: Upload haskell-debugger source distribution
uses: actions/upload-artifact@v4
with:
name: Haskell Debugger Source Distribution
# This will catch both haskell-debugger and haskell-debugger-view
path: dist-newstyle/sdist/haskell-debugger*.tar.gz
# Tests run on the distributed sdist to catch packaging issues.
build-n-test-haskell-debugger:
name: Build and Run Tests on Sdist
needs: sdist-haskell-debugger
runs-on: ubuntu-latest # just one is fine here, we test more machines on the checkout
continue-on-error: ${{ inputs.is-release == false }}
strategy:
matrix:
version: [9.14.1]
include:
- channel: https://raw.githubusercontent.com/haskell/ghcup-metadata/refs/heads/develop/ghcup-prereleases-0.0.9.yaml
version: 9.14.1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/cache@v3
with:
path: |
~/.cabal/store
key: ${{ runner.os }}-integration-ghc-${{ matrix.version }}-cabal-${{ hashFiles('**/*.cabal', 'cabal.project*') }}
restore-keys: |
${{ runner.os }}-integration-ghc-${{ matrix.version }}-cabal-
- uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.version }}
cabal-version: 3.16
ghcup-release-channel: ${{ matrix.channel }}
- name: Download hdb source dist
uses: actions/download-artifact@v4
with:
name: Haskell Debugger Source Distribution
path: ${{ runner.temp }}/dist
- name: Untar haskell-debugger
run: |
(cd ${{ runner.temp }}/dist && tar xzf "haskell-debugger-${{env.haskellDebuggerVersion}}.tar.gz")
- name: Setup local version of haskell-debugger-view
if: env.USE_HASKELL_DEBUGGER_VIEW_FROM_HACKAGE
run: |
(cd ${{ runner.temp }}/dist && tar xzf "haskell-debugger-view-${{env.haskellDebuggerViewVersion}}.tar.gz" && mv "haskell-debugger-view-${{env.haskellDebuggerViewVersion}}" "haskell-debugger-${{env.haskellDebuggerVersion}}/haskell-debugger-view")
(cd ${{ runner.temp }}/dist/haskell-debugger-${{env.haskellDebuggerVersion}} && echo 'packages: . ./haskell-debugger-view' > cabal.project)
- name: Build and Run tests
run: |
echo "Using haskell-debugger-view from hackage: ${{env.USE_HASKELL_DEBUGGER_VIEW_FROM_HACKAGE}}"
cd ${{ runner.temp }}/dist/haskell-debugger-${{env.haskellDebuggerVersion}}
cabal run haskell-debugger-test --enable-executable-dynamic --allow-newer=ghc-bignum,containers,time,ghc,base,template-haskell --ghc-options=-Werror
# Tests run on the git checkout
build-n-more-test-haskell-debugger:
name: Build and Run Tests on checkout (${{ matrix.runner }})
runs-on: ${{ matrix.runner }}
# Run all jobs in the matrix to the end (IF RELEASE, STOP ON FAILURE)
continue-on-error: ${{ inputs.is-release == false }}
strategy:
matrix:
runner: [ubuntu-latest, macOS-latest] # windows-latest is broken, see #246
version: [9.14.1] #, latest-nightly] disable nightly while its broken
include:
# - channel: https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml
# version: latest-nightly
- channel: https://raw.githubusercontent.com/haskell/ghcup-metadata/refs/heads/develop/ghcup-prereleases-0.0.9.yaml
version: 9.14.1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Cache GHC for macOS" # See haskell-actions/setup#139
id: cache-haskell
uses: actions/cache@v5
if: matrix.runner == 'macOS-latest'
with:
path: ~/.ghcup
key: ${{ runner.os }}-ghc-${{ matrix.version }}
restore-keys: ${{ runner.os }}-ghc-${{ matrix.version }}
- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.version }}
cabal-version: 3.16
ghcup-release-channel: ${{ matrix.channel }}
- name: Configure the build
run: |
cabal build all --dry-run \
--enable-executable-dynamic --enable-tests \
--enable-benchmarks --disable-documentation
# The last step generates dist-newstyle/cache/plan.json for the cache key.
- name: Restore cached dependencies
uses: actions/cache/restore@v4
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-
- name: Install dependencies
# If we had an exact cache hit, the dependencies will be up to date.
if: steps.cache.outputs.cache-hit != 'true'
run: cabal build all --only-dependencies
# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
- name: Save cached dependencies
uses: actions/cache/save@v4
# If we had an exact cache hit, trying to save the cache would error because of key clash.
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: Build and Run Haskell tests
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
cabal run haskell-debugger-test --allow-newer=ghc-bignum,containers,time,ghc,base,template-haskell
else
cabal run haskell-debugger-test --enable-executable-dynamic --allow-newer=ghc-bignum,containers,time,ghc,base,template-haskell
fi