-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (37 loc) · 1.21 KB
/
buildtest.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
name: Build and Test VS Code Extension
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# VS Code uses Node 18
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn install
- run: yarn test:ci
- name: Package the extension
id: package
run: |
yarn package
PACKAGE_PATH=$(find . -name 'vscode-bazel-bsp-*.vsix')
PACKAGE_NAME_WITH_SHA="${PACKAGE_PATH%.vsix}-$(echo $GITHUB_SHA | cut -c1-7).vsix"
echo "package_path=$PACKAGE_PATH" >> $GITHUB_ENV
echo "package_name_with_sha=$(basename $PACKAGE_NAME_WITH_SHA)" >> $GITHUB_ENV
- name: Upload packaged extension artifact
# Artifact is only uploaded on push to main, to preserve artifact storage capacity.
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: ${{ env.package_name_with_sha }}
path: ${{ env.package_path }}