Repository navigation
159 lines (125 loc) · 3.68 KB
/
Copy pathtest.yml
File metadata and controls
159 lines (125 loc) · 3.68 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
on: [push]
name: Test
env:
RUSTFLAGS: "-Dwarnings --cfg tracing_unstable"
jobs:
cargo-build:
name: Cargo Build
runs-on: ubuntu-latest-16-cores
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Install protoc
run: |
sudo apt-get install -y protobuf-compiler
- name: Build project
run: cargo build
node-setup:
name: Node Setup
runs-on: ubuntu-latest-16-cores
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: polybase-ts
repository: polybase/polybase-ts
token: ${{ secrets.ADMIN_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'
cache-dependency-path: ./polybase-ts/yarn.lock
- name: Install deps
working-directory: polybase-ts
run: yarn install
unit-test:
name: Unit Tests
runs-on: ubuntu-latest-16-cores
needs: cargo-build
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Install protoc
run: |
sudo apt-get install -y protobuf-compiler
- name: Run unit tests
run: cargo test
e2e-test:
name: E2E Tests
runs-on: ubuntu-latest-16-cores
needs: [cargo-build, node-setup]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
path: polybase-ts
repository: polybase/polybase-ts
token: ${{ secrets.ADMIN_TOKEN }}
- uses: Swatinem/rust-cache@v2
- name: Install protoc
run: |
sudo apt-get install -y protobuf-compiler
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'
cache-dependency-path: ./polybase-ts/yarn.lock
- name: Build server
run: cargo build
- name: Run server
run: cargo run --bin polybase &
- name: Install deps
working-directory: polybase-ts
run: yarn install && yarn build
- name: Wait for server
run: |
timeout 30 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8080)" != "200" ]]; do sleep 1; done' || false
- name: Run E2E tests
working-directory: polybase-ts/packages/client
run: yarn test:e2e
build:
name: Build & Run
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Depot
uses: depot/setup-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker
uses: depot/build-push-action@v1
with:
context: .
file: ./docker/Dockerfile
push: false
load: true
tags: polybase-build
- name: Run Docker
run: |
docker run -d -p 8080:8080 --name=polybase polybase-build
- name: Wait for port to be ready
run: |
timeout 5 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8080)" != "200" ]]; do sleep 1; done' || false
- name: CURL
run: curl -sSf http://localhost:8080
clippy:
name: Clippy Check
runs-on: ubuntu-latest-16-cores
needs: cargo-build
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Install protoc
run: |
sudo apt-get install -y protobuf-compiler
- name: Run Clippy
run: cargo clippy --all-targets --all-features