Skip to content

Commit 00da470

Browse files
authored
Split out packaging action (#1080)
* Split out packaging action * Use Haskell Actions to setup ghcup on all platforms * Update GHC versions in the CI * Downgrade macos image
1 parent 99fbd75 commit 00da470

File tree

2 files changed

+47
-14
lines changed

2 files changed

+47
-14
lines changed

.github/workflows/package.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
branches:
7+
- '**'
8+
9+
jobs:
10+
build:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [ubuntu-latest]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Install Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
## make sure this corresponds with the version in release.yml
24+
node-version: latest
25+
26+
27+
- run: yarn install --immutable --immutable-cache --check-cache
28+
29+
- name: Package extension
30+
run: npx vsce package
31+
- name: Upload extension vsix to workflow artifacts
32+
uses: actions/upload-artifact@v3
33+
with:
34+
name: haskell-${{ github.sha }}.vsix
35+
path: haskell-*.vsix

.github/workflows/test.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
os: [macos-latest, ubuntu-latest, windows-latest]
15-
ghc: [8.10.7, 9.0.2, 9.2.8, 9.4.7, 9.6.2]
14+
os: [macos-12, ubuntu-latest, windows-latest]
15+
ghc: [8.10.7, 9.4.8, 9.6.4, 9.8.2]
1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- name: Checkout
@@ -28,6 +28,11 @@ jobs:
2828
- run: yarn install --immutable --immutable-cache --check-cache
2929
- run: yarn run webpack
3030

31+
# Setup toolchains, install ghcup, install ghc, etc...
32+
- name: Setup Haskell
33+
uses: haskell-actions/setup@v2
34+
with:
35+
ghc-version: ${{ matrix.ghc }}
3136
- name: Toolchain settings
3237
run: |
3338
ghcup upgrade -i -f
@@ -37,9 +42,12 @@ jobs:
3742
ghcup install stack latest
3843
ghcup install cabal latest
3944
40-
ghcup install ghc ${{matrix.ghc}}
41-
ghcup set ghc ${{matrix.ghc}}
45+
ghcup install ghc ${{ matrix.ghc }}
46+
ghcup set ghc ${{ matrix.ghc }}
4247
48+
# This is a prefetched, fallback HLS version.
49+
# We want to make sure, we still support old GHC versions
50+
# and graciously fallback to an HLS version that supports the old GHC version, such as 8.10.7
4351
ghcup install hls 2.2.0.0
4452
ghcup install hls latest
4553
shell: bash
@@ -76,13 +84,3 @@ jobs:
7684
rm -rf test-workspace
7785
rm -rf out
7886
shell: bash
79-
80-
- name: Package tested extension
81-
if: runner.os == 'Linux'
82-
run: npx vsce package
83-
- name: Upload extension vsix to workflow artifacts
84-
if: runner.os == 'Linux'
85-
uses: actions/upload-artifact@v3
86-
with:
87-
name: haskell-${{ github.sha }}.vsix
88-
path: haskell-*.vsix

0 commit comments

Comments
 (0)