-
Notifications
You must be signed in to change notification settings - Fork 90
88 lines (78 loc) · 2.59 KB
/
test.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
on:
push:
branches:
- master
pull_request:
branches:
- '**'
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [macos-11, ubuntu-latest, windows-latest]
ghc: [8.10.4, 8.10.7, 9.0.2, 9.2.8, 9.4.5, 9.6.2]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
## make sure this corresponds with the version in release.yml
node-version: latest
# Install test dependencies
- run: yarn install --immutable --immutable-cache --check-cache
- run: yarn run webpack
- name: Toolchain settings
run: |
ghcup upgrade -i -f
export GHCUP_INSTALL_BASE_PREFIX=$(pwd)/test-workspace/bin
ghcup config set cache true
ghcup install stack latest
ghcup install cabal latest
ghcup install ghc ${{matrix.ghc}}
ghcup set ghc ${{matrix.ghc}}
ghcup install hls 1.4.0
ghcup install hls latest
shell: bash
# Run the tests
- name: Run the test on Linux
run: |
export GHCUP_INSTALL_BASE_PREFIX=$(pwd)/test-workspace/bin
export PATH="$(pwd)/test-workspace/bin/.ghcup/bin:$PATH"
xvfb-run -s '-screen 0 640x480x16' -a yarn run test
shell: bash
if: runner.os == 'Linux'
- name: Run the test on macOS
run: |
export GHCUP_INSTALL_BASE_PREFIX=$(pwd)/test-workspace/bin
export PATH="$(pwd)/test-workspace/bin/.ghcup/bin:$PATH"
yarn run test
shell: bash
if: runner.os == 'macOS'
- name: Run the test on Windows
run: |
export GHCUP_INSTALL_BASE_PREFIX=$(pwd)/test-workspace/bin
export PATH="$(pwd)/test-workspace/bin/ghcup/bin:$PATH"
yarn run test
shell: bash
if: runner.os == 'Windows'
# Create package artefacts
- name: Delete test artefacts
# The test-suite doesn't clean up correctly after itself.
# This is a poor man's workaround that after test execution,
# the test-workspace still contains binaries and caches.
run: |
rm -rf test-workspace
rm -rf out
shell: bash
- name: Package tested extension
if: runner.os == 'Linux'
run: npx vsce package
- name: Upload extension vsix to workflow artifacts
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: haskell-${{ github.sha }}.vsix
path: haskell-*.vsix