Skip to content

Commit d8967c1

Browse files
committed
ci: Run golden tests on macOS and Windows
Runs the in-tree golden tests on macOS and Windows too. Eventually it'd be good to also build and test on these platforms directly from the source tarball. Fixes #147
1 parent 4c052fd commit d8967c1

File tree

4 files changed

+26
-17
lines changed

4 files changed

+26
-17
lines changed

.github/workflows/debugger.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ name: Debugger CI
2525
jobs:
2626
build-vscode-extension:
2727
name: Build VSCode Extension
28-
runs-on: ubuntu-latest # or macOS-latest, or windows-latest
28+
runs-on: ubuntu-latest
2929
steps:
3030
- uses: actions/checkout@v4
3131
with:
@@ -136,12 +136,13 @@ jobs:
136136
137137
# Golden+Haskell tests are run on the git checkout
138138
build-n-more-test-haskell-debugger:
139-
name: Build and Run Haskell Tests
140-
runs-on: ubuntu-latest
141-
# Run all jobs in the matrix to the end (IF NOT ON RELEASE)
139+
name: Build and Run Haskell Tests (${{ matrix.runner }})
140+
runs-on: ${{ matrix.runner }}
141+
# Run all jobs in the matrix to the end (IF RELEASE, STOP ON FAILURE)
142142
continue-on-error: ${{ inputs.is-release == false }}
143143
strategy:
144144
matrix:
145+
runner: [ubuntu-latest, macOS-latest, windows-latest] # it'd be good to also build-from-hackage on windows and macOS
145146
version: [9.14.0.20251104] #, latest-nightly] disable nightly while its broken
146147
include:
147148
# - channel: https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml
@@ -156,8 +157,7 @@ jobs:
156157
# Cabal store cache (main speed-up)
157158
- uses: actions/cache@v3
158159
with:
159-
path: |
160-
~/.cabal/store
160+
path: ~/.cabal/store
161161
key: ${{ runner.os }}-ghc-${{ matrix.version }}-cabal-${{ hashFiles('**/*.cabal', 'cabal.project*') }}
162162
restore-keys: |
163163
${{ runner.os }}-ghc-${{ matrix.version }}-cabal-
@@ -168,11 +168,11 @@ jobs:
168168
cabal-version: 3.14
169169
ghcup-release-channel: ${{ matrix.channel }}
170170

171-
- uses: cachix/install-nix-action@v31
172-
with:
173-
nix_path: nixpkgs=channel:nixos-unstable
174-
175-
- name: Build and Run integration tests
171+
- name: Build and Run Haskell tests
172+
shell: bash
176173
run: |
177-
echo "Running Haskell Testsuite now..."
178-
cabal run haskell-debugger-test --enable-executable-dynamic --allow-newer=ghc-bignum,containers,time,ghc,base,template-haskell
174+
if [ "$RUNNER_OS" == "Windows" ]; then
175+
cabal run haskell-debugger-test --allow-newer=ghc-bignum,containers,time,ghc,base,template-haskell
176+
else
177+
cabal run haskell-debugger-test --enable-executable-dynamic --allow-newer=ghc-bignum,containers,time,ghc,base,template-haskell
178+
fi

cabal.project

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ packages: . haskell-debugger-view
22

33
allow-newer: ghc-bignum,containers,time,ghc,base,template-haskell
44

5-
package *
6-
-- Speeds up a bit
7-
library-vanilla: False
5+
if !os(windows)
6+
package *
7+
-- Speeds up a bit
8+
library-vanilla: False
89

9-
executable-dynamic: True
10+
if !os(windows)
11+
executable-dynamic: True
1012

haskell-debugger.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ test-suite haskell-debugger-test
189189
tasty >= 1.5.3,
190190
tasty-golden >= 2.3.5,
191191
tasty-hunit >= 0.10.2,
192+
tasty-expected-failure >= 0.12.3,
192193
regex >= 1.1
193194
build-tool-depends: haskell-debugger:hdb
194195
ghc-options: -threaded

test/haskell/Test/DAP/RunInTerminal.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{-# LANGUAGE OverloadedStrings #-}
44
{-# LANGUAGE OverloadedRecordDot #-}
55
{-# LANGUAGE LambdaCase #-}
6+
{-# LANGUAGE CPP #-}
67
module Test.DAP.RunInTerminal (runInTerminalTests) where
78

89
import Control.Concurrent
@@ -17,6 +18,7 @@ import System.Random
1718
import Test.DAP
1819
import Test.Tasty
1920
import Test.Tasty.HUnit
21+
import Test.Tasty.ExpectedFailure
2022
import Test.Utils
2123
import qualified Data.ByteString.Lazy as LBS
2224
import qualified Data.ByteString.Lazy.Char8 as LB8
@@ -33,6 +35,10 @@ rit_keep_tmp_dirs :: Bool
3335
rit_keep_tmp_dirs = False
3436

3537
runInTerminal1 = do
38+
#ifdef mingw32_HOST_OS
39+
expectFail "Needs to be fixed for Windows"
40+
#endif
41+
3642
withHermeticDir rit_keep_tmp_dirs "test/unit/T44" $ \test_dir -> do
3743

3844
-- Come up with a random port

0 commit comments

Comments
 (0)