|
| 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