Skip to content

Commit

Permalink
Add unit tests action (#1508)
Browse files Browse the repository at this point in the history
## Changes
We've removed unit tests from the integ action

## Tests
<!-- How is this tested? -->
  • Loading branch information
ilia-db authored Jan 2, 2025
1 parent 8c68a3f commit cc095b3
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Unit Tests

on:
pull_request:
types: [opened, synchronize]

jobs:
unit-test-extension:
name: Run unit tests
strategy:
fail-fast: false
matrix:
arch:
- cli_arch: darwin_amd64
os: macos-latest
- cli_arch: windows_amd64
os: windows-latest
node-version: [18.x]
vscode-version: [stable]

runs-on: ${{ matrix.arch.os }}

env:
VSCODE_TEST_VERSION: ${{ matrix.vscode-version }}
CLI_ARCH: ${{ matrix.arch.cli_arch }}

defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"

- name: Cache VSCode unit test runner
uses: actions/cache@v3
with:
path: /tmp/vscode-test-databricks
key: ${{ matrix.arch.cli_arch }}-${{ matrix.vscode-version }}-vscode-test

- run: yarn install --immutable

- name: Prettier and Linting
run: yarn run test:lint
working-directory: packages/databricks-vscode

- name: Fetching Databricks CLI
run: yarn run package:cli:fetch
working-directory: packages/databricks-vscode
env:
GH_TOKEN: ${{ github.token }}

- name: Building packages
run: yarn run build

- name: Unit Tests with Coverage
uses: coactions/setup-xvfb@v1
with:
run: yarn run test:cov
working-directory: packages/databricks-vscode

0 comments on commit cc095b3

Please sign in to comment.