-
Notifications
You must be signed in to change notification settings - Fork 7
72 lines (61 loc) · 1.83 KB
/
test-build.yml
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
name: Test build
on:
pull_request:
branches:
- main
jobs:
test-build:
name: Test build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run vale spell and style check
continue-on-error: true
uses: errata-ai/vale-action@reviewdog
with:
files: docs
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Test build website
run: yarn build
# Test TypeScript code snippets
- name: Compile TypeScript code snippets
run: npm install --prefix code_snippets/ts && npm run build --prefix code_snippets/ts
- name: Check if TypeScript code snippets build is successful
run: |
if [ -d "code_snippets/ts/dist" ]; then
echo "TypeScript compilation successful"
else
echo "TypeScript compilation failed"
exit 1
fi
# Setup Java
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "21"
# Check Java code snippets
- name: Test Java code snippets
uses: gradle/gradle-build-action@v2
with:
arguments: check
build-root-directory: code_snippets/java
# Check Java code snippets
- name: Test Kotlin code snippets
uses: gradle/gradle-build-action@v2
with:
arguments: check
build-root-directory: code_snippets/kotlin
# Setup Go
- uses: actions/setup-go@v5
if: github.event.inputs.sdkGoVersion != ''
with:
go-version: "1.21"
# Check Go code snippets
- name: Test Go code snippets
working-directory: code_snippets/go
run: go test ./...