Skip to content

Commit 9c1746b

Browse files
authored
Refactor workflows (#29)
* refactor workflows * run nightly release for main branch
1 parent b5963f7 commit 9c1746b

2 files changed

Lines changed: 106 additions & 3 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish nightly release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
archive-build-artifacts:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
13+
- name: Use Node.js 18.x
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: 18.x
17+
18+
- run: yarn install
19+
- run: yarn run build
20+
21+
- run: yarn run vscode:package
22+
working-directory: packages/databricks-vscode
23+
24+
- name: Update nightly release
25+
uses: eine/tip@master
26+
with:
27+
tag: nightly
28+
rm: true
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
files: "packages/databricks-vscode/*.vsix"

.github/workflows/push.yml

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,71 @@ on:
77
branches: [main]
88

99
jobs:
10-
test:
10+
unit-test-sdk:
11+
name: Unit Test Databricks SDK
1112
runs-on: ${{ matrix.os }}
1213

14+
strategy:
15+
matrix:
16+
os: [windows-latest, ubuntu-latest]
17+
node-version: [14.x, 18.x]
18+
19+
defaults:
20+
run:
21+
shell: bash
22+
working-directory: packages/databricks-sdk-js
23+
24+
steps:
25+
- uses: actions/checkout@v3
26+
27+
- name: Use Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
cache: "yarn"
32+
33+
- run: yarn install --immutable
34+
35+
- name: Building packages
36+
run: yarn run build
37+
38+
- name: Prettier and Linting
39+
run: yarn run test:lint
40+
41+
- name: Unit Tests
42+
run: yarn test:run
43+
44+
integ-test-sdk:
45+
name: Integration Test Databricks SDK
46+
runs-on: ubuntu-latest
47+
48+
defaults:
49+
run:
50+
working-directory: packages/databricks-sdk-js
51+
52+
steps:
53+
- uses: actions/checkout@v3
54+
55+
- name: Use Node.js 18.x
56+
uses: actions/setup-node@v3
57+
with:
58+
node-version: 18.x
59+
cache: "yarn"
60+
61+
- run: yarn install --immutable
62+
63+
- name: Integration Tests
64+
run: yarn run test:integ
65+
env:
66+
DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }}
67+
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }}
68+
DATABRICKS_CLUSTER_ID: ${{ secrets.DATABRICKS_CLUSTER_ID }}
69+
70+
test-extension:
71+
name: Test VSCode Extension
72+
runs-on: ${{ matrix.os }}
73+
needs: [unit-test-sdk, integ-test-sdk]
74+
1375
strategy:
1476
matrix:
1577
os: [windows-latest, macos-latest]
@@ -30,32 +92,43 @@ jobs:
3092

3193
- run: yarn install --immutable
3294

95+
- name: Prettier and Linting
96+
run: yarn run test:lint
97+
working-directory: packages/databricks-vscode
98+
3399
- name: Building packages
34100
run: yarn run build
35101

102+
- run: yarn run test:compile
103+
working-directory: packages/databricks-vscode
104+
36105
- name: Tests (OSX)
37106
uses: GabrielBB/xvfb-action@v1
38107
if: matrix.os != 'windows-latest'
39108
env:
40109
NODE_OPTIONS: "--max-old-space-size=8192"
41110
with:
42-
run: yarn test
111+
run: yarn run test:unit
112+
working-directory: packages/databricks-vscode
43113

44114
- name: Tests (Windows)
45115
if: matrix.os == 'windows-latest'
46-
run: yarn test
116+
run: yarn run test:unit
117+
working-directory: packages/databricks-vscode
47118
env:
48119
NODE_OPTIONS: "--max-old-space-size=8192"
49120

50121
- name: Integration Tests
51122
run: yarn run test:integ
123+
working-directory: packages/databricks-vscode
52124
env:
53125
DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }}
54126
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }}
55127
DATABRICKS_CLUSTER_ID: ${{ secrets.DATABRICKS_CLUSTER_ID }}
56128

57129
package:
58130
name: Package VSIX
131+
needs: "test-extension"
59132
runs-on: "macos-latest"
60133
steps:
61134
- uses: actions/checkout@v3

0 commit comments

Comments
 (0)