-
Notifications
You must be signed in to change notification settings - Fork 6
137 lines (116 loc) · 3.53 KB
/
master.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: master
on:
push:
branches:
- master
tags:
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
- master
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
ghc:
- 8.10.7
- 9.0.2
- 9.4.5
env:
- { CODE_VERSION: 1.66.2, DISPLAY: ':99.0' }
- { CODE_VERSION: 'stable', DISPLAY: ':99.0' }
runs-on: ${{ matrix.os }}
env: ${{ matrix.env }}
steps:
- uses: actions/checkout@v4
- name: Set up npm
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Haskell Stack
if: runner.os == 'macOS'
run: |
brew install llvm@12
echo "/opt/homebrew/opt/llvm@12/bin" >> $GITHUB_PATH
brew install haskell-stack
- name: Set up GHC ${{ matrix.ghc }} environment
run: |
echo "resolver: ghc-${{ matrix.ghc }}" > stack.yaml
echo "packages: []" >> stack.yaml
stack setup
- run: npm install
- name: Run npm test
uses: coactions/setup-xvfb@v1
with:
run: npm test
- name: Add GHC extension output (on failure on Linux or MacOS)
if: failure() && runner.os != 'Windows'
run: find .vscode-test/udd/logs -name *GHC* -exec cat {} \;
- name: Add GHC extension output (on failure on Windows)
if: failure() && runner.os == 'Windows'
run: Get-ChildItem -Path .vscode-test -Include *GHC.log -File -Recurse | Get-Content
metrics:
runs-on: ubuntu-latest
env: { CODE_VERSION: 'stable', DISPLAY: ':99.0', GHC: 9.4.5 }
steps:
- uses: actions/checkout@v4
- name: Set up npm
uses: actions/setup-node@v4
with:
node-version: 20
- name: Set up GHC ${{ env.GHC }} environment
run: |
echo "resolver: ghc-${{ env.GHC }}" > stack.yaml
echo "packages: []" >> stack.yaml
stack setup
- run: npm install
- name: Run tests with coverage
uses: coactions/setup-xvfb@v1
with:
run: npm run coverage
- name: Publish coverage on Coveralls.io
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: .coverage/lcov.info
release:
needs:
- build
- metrics
runs-on: ubuntu-latest
env:
RELEASE_BODY_FILE: ${{ github.workspace }}/release-description.md
steps:
- uses: actions/checkout@v4
- name: Set up npm
uses: actions/setup-node@v4
with:
node-version: 20
- name: Build package
run: |
npm install
npm run package
- name: Create release notes
run: |
echo "RELEASE=$(git show -q --format=format:%s)" >> $GITHUB_ENV
git show -q --format=format:%b > ${{ env.RELEASE_BODY_FILE }}
- name: Create release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
with:
commit: ${{ github.sha }}
name: ${{ env.RELEASE }}
bodyFile: ${{ env.RELEASE_BODY_FILE }}
artifacts: haskutil-*.vsix
makeLatest: ${{ startsWith(github.event.base_ref, 'refs/heads/master') }}
prerelease: ${{ !startsWith(github.event.base_ref, 'refs/heads/master') }}
- name: Upload new version to MS Marketplace
if: github.event_name == 'push' && startsWith(github.event.base_ref, 'refs/heads/master')
run: npm run upload
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}