generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
132 lines (131 loc) · 3.71 KB
/
ci.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
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
on:
push:
branches:
- main
pull_request:
name: CI
concurrency:
group: ${{ github.ref }}-ci
cancel-in-progress: true
jobs:
kotlin-runtime:
name: Test Kotlin
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Init Hermit
uses: cashapp/activate-hermit@v1
- name: Build Cache
uses: ./.github/actions/build-cache
- name: Test
run: mvn test --batch-mode
test:
name: Test Go
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Init Hermit
uses: cashapp/activate-hermit@v1
- name: Build Cache
uses: ./.github/actions/build-cache
- name: Docker Compose
run: docker compose up -d --wait
- name: Test
run: go test ./...
sql:
name: SQL
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Init Hermit
uses: cashapp/activate-hermit@v1
- name: Build Cache
uses: ./.github/actions/build-cache
- name: Docker Compose
run: docker compose up -d --wait
- name: Initialise database
run: ftl-initdb --recreate
- name: Vet SQL
run: sqlc vet
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Init Hermit
uses: cashapp/activate-hermit@v1
- name: Build Cache
uses: ./.github/actions/build-cache
- name: golangci-lint
run: golangci-lint run
- name: go-check-sumtype
run: go-check-sumtype ./...
- name: actionlint
run: actionlint --oneline
# Too annoying to disable individual warnings
# - name: staticcheck
# run: staticcheck ./...
- name: shellcheck
run: shellcheck -e SC2016 scripts/*
proto-breaking:
name: Proto Breaking Change Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Init Hermit
uses: cashapp/activate-hermit@v1
- name: Proto Breaking Change Check
run: |
buf breaking --against 'https://github.com/TBD54566975/ftl.git#branch=main' | while read -r line; do
# Extract the file path, line number, and column number from the warning message
file_path=$(echo "$line" | cut -d':' -f1)
line_number=$(echo "$line" | cut -d':' -f2)
column_number=$(echo "$line" | cut -d':' -f3)
# Output the warning message in the format expected by GitHub Actions
echo "::error file=$file_path,line=$line_number,col=$column_number::$line"
done
console:
name: Console
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Init Hermit
uses: cashapp/activate-hermit@v1
- name: Build Cache
uses: ./.github/actions/build-cache
- name: Console NPM Install
working-directory: frontend
run: npm install
- name: Console Type Check
working-directory: frontend
run: tsc
- name: Console Lint
working-directory: frontend
run: npm run lint
- name: Console Test
working-directory: frontend
run: npm run test
integration:
name: Integration Tests
if: github.ref == 'refs/heads/main'
uses: ./.github/workflows/integration.yml
autoversion:
name: Auto Version
secrets: inherit
if: github.ref == 'refs/heads/main'
needs:
- kotlin-runtime
- test
- lint
- console
- integration
- sql
uses: ./.github/workflows/autoversion.yml