Skip to content

Commit e20584e

Browse files
July541fendor
authored andcommitted
Simplify tests
1 parent 182f3f8 commit e20584e

File tree

2 files changed

+137
-193
lines changed

2 files changed

+137
-193
lines changed

.github/workflows/test.yml

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,66 +12,71 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
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]
1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@v3
20+
2021
- name: Install Node.js
2122
uses: actions/setup-node@v3
2223
with:
2324
## make sure this corresponds with the version in release.yml
2425
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
4826

4927
# Install test dependencies
5028
- run: yarn install --immutable --immutable-cache --check-cache
5129
- run: yarn run webpack
5230

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+
5347
# 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
5554
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'
6669

6770
# Create package artefacts
6871
- name: Delete test artefacts
6972
# The test-suite doesn't clean up correctly after itself.
7073
# This is a poor man's workaround that after test execution,
7174
# the test-workspace still contains binaries and caches.
7275
run: |
73-
rm -rf test-workspace/
76+
rm -rf test-workspace
77+
rm -rf out
7478
shell: bash
79+
7580
- name: Package tested extension
7681
if: runner.os == 'Linux'
7782
run: npx vsce package

0 commit comments

Comments
 (0)