Skip to content

Commit cc095b3

Browse files
authored
Add unit tests action (#1508)
## Changes We've removed unit tests from the integ action ## Tests <!-- How is this tested? -->
1 parent 8c68a3f commit cc095b3

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/unit-tests.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Unit Tests
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
7+
jobs:
8+
unit-test-extension:
9+
name: Run unit tests
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
arch:
14+
- cli_arch: darwin_amd64
15+
os: macos-latest
16+
- cli_arch: windows_amd64
17+
os: windows-latest
18+
node-version: [18.x]
19+
vscode-version: [stable]
20+
21+
runs-on: ${{ matrix.arch.os }}
22+
23+
env:
24+
VSCODE_TEST_VERSION: ${{ matrix.vscode-version }}
25+
CLI_ARCH: ${{ matrix.arch.cli_arch }}
26+
27+
defaults:
28+
run:
29+
shell: bash
30+
31+
steps:
32+
- uses: actions/checkout@v3
33+
34+
- name: Use Node.js ${{ matrix.node-version }}
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: ${{ matrix.node-version }}
38+
cache: "yarn"
39+
40+
- name: Cache VSCode unit test runner
41+
uses: actions/cache@v3
42+
with:
43+
path: /tmp/vscode-test-databricks
44+
key: ${{ matrix.arch.cli_arch }}-${{ matrix.vscode-version }}-vscode-test
45+
46+
- run: yarn install --immutable
47+
48+
- name: Prettier and Linting
49+
run: yarn run test:lint
50+
working-directory: packages/databricks-vscode
51+
52+
- name: Fetching Databricks CLI
53+
run: yarn run package:cli:fetch
54+
working-directory: packages/databricks-vscode
55+
env:
56+
GH_TOKEN: ${{ github.token }}
57+
58+
- name: Building packages
59+
run: yarn run build
60+
61+
- name: Unit Tests with Coverage
62+
uses: coactions/setup-xvfb@v1
63+
with:
64+
run: yarn run test:cov
65+
working-directory: packages/databricks-vscode

0 commit comments

Comments
 (0)