@@ -12,66 +12,71 @@ jobs:
12
12
fail-fast : false
13
13
matrix :
14
14
os : [macos-11, ubuntu-latest, windows-latest]
15
- ghc : [8.10.4, 9.2.7 , 9.6.1 ]
15
+ ghc : [8.10.4, 8.10.7, 9.0.2, 9.2.8 , 9.4.5, 9.6.2 ]
16
16
runs-on : ${{ matrix.os }}
17
17
steps :
18
18
- name : Checkout
19
19
uses : actions/checkout@v3
20
+
20
21
- name : Install Node.js
21
22
uses : actions/setup-node@v3
22
23
with :
23
24
# # make sure this corresponds with the version in release.yml
24
25
node-version : latest
25
- - name : Upgrade ghcup
26
- run : ghcup upgrade -i -f
27
- shell : bash
28
- # Setup the environment for the tests
29
- - name : Install stack
30
- run : ghcup install stack recommended
31
- - name : Install cabal
32
- run : ghcup install cabal recommended
33
- - name : Install GHC
34
- run : |
35
- ghcup install ghc ${{matrix.ghc}}
36
- ghcup set ghc ${{matrix.ghc}}
37
- # Pre-fetch HLS binaries before the tests because otherwise
38
- # we run into timeouts. Downloading takes longer, since we download
39
- # per HLS version one HLS binary per GHC version.
40
- - run : |
41
- mkdir -p test-workspace/bin/
42
- export GHCUP_INSTALL_BASE_PREFIX=$(pwd)/test-workspace/bin
43
- echo $XDG_BIN_HOME $GHCUP_INSTALL_BASE_PREFIX
44
- ghcup config set cache true
45
- ghcup --no-verbose prefetch hls 1.4.0
46
- ghcup --no-verbose prefetch hls latest
47
- shell: bash
48
26
49
27
# Install test dependencies
50
28
- run : yarn install --immutable --immutable-cache --check-cache
51
29
- run : yarn run webpack
52
30
31
+ - name : Toolchain settings
32
+ run : |
33
+ ghcup upgrade -i -f
34
+ export GHCUP_INSTALL_BASE_PREFIX=$(pwd)/test-workspace/bin
35
+ ghcup config set cache true
36
+
37
+ ghcup install stack latest
38
+ ghcup install cabal latest
39
+
40
+ ghcup install ghc ${{matrix.ghc}}
41
+ ghcup set ghc ${{matrix.ghc}}
42
+
43
+ ghcup install hls 1.4.0
44
+ ghcup install hls latest
45
+ shell : bash
46
+
53
47
# Run the tests
54
- - run : xvfb-run -s '-screen 0 640x480x16' -a yarn run test
48
+ - name : Run the test on Linux
49
+ run : |
50
+ export GHCUP_INSTALL_BASE_PREFIX=$(pwd)/test-workspace/bin
51
+ export PATH="$(pwd)/test-workspace/bin/.ghcup/bin:$PATH"
52
+ xvfb-run -s '-screen 0 640x480x16' -a yarn run test
53
+ shell : bash
55
54
if : runner.os == 'Linux'
56
- - run : yarn run test
57
- if : runner.os != 'Linux'
58
-
59
- # Upload test artefacts
60
- - name : Upload log file to workflow artifacts on error
61
- if : failure()
62
- uses : actions/upload-artifact@v3
63
- with :
64
- name : extension-${{ matrix.os }}.log
65
- path : test-workspace/hls.log
55
+ - name : Run the test on macOS
56
+ run : |
57
+ export GHCUP_INSTALL_BASE_PREFIX=$(pwd)/test-workspace/bin
58
+ export PATH="$(pwd)/test-workspace/bin/.ghcup/bin:$PATH"
59
+ yarn run test
60
+ shell : bash
61
+ if : runner.os == 'macOS'
62
+ - name : Run the test on Windows
63
+ run : |
64
+ export GHCUP_INSTALL_BASE_PREFIX=$(pwd)/test-workspace/bin
65
+ export PATH="$(pwd)/test-workspace/bin/ghcup/bin:$PATH"
66
+ yarn run test
67
+ shell : bash
68
+ if : runner.os == 'Windows'
66
69
67
70
# Create package artefacts
68
71
- name : Delete test artefacts
69
72
# The test-suite doesn't clean up correctly after itself.
70
73
# This is a poor man's workaround that after test execution,
71
74
# the test-workspace still contains binaries and caches.
72
75
run : |
73
- rm -rf test-workspace/
76
+ rm -rf test-workspace
77
+ rm -rf out
74
78
shell : bash
79
+
75
80
- name : Package tested extension
76
81
if : runner.os == 'Linux'
77
82
run : npx vsce package
0 commit comments