-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (44 loc) · 1.29 KB
/
ci.yaml
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
name: CI
on:
pull_request:
branches:
- 'main'
push:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.19', '1.20', '1.21', '1.22', '1.23']
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Build Confidence
run: cd pkg/confidence && go build -v .
- name: Build Provider
run: cd pkg/provider && go build -v .
- name: Test Confidence
run: cd pkg/confidence && go test -v
- name: Test Provider
run: cd pkg/provider && go test -v
- name: Run gofmt
run: |
modules=("pkg/confidence" "pkg/provider" "demo" "demo-open-feature")
fmt_issues=""
for module in "${modules[@]}"; do
fmt_output=$(gofmt -l "$module")
if [ -n "$fmt_output" ]; then
fmt_issues+="$fmt_output"$'\n'
fi
done
if [ -n "$fmt_issues" ]; then
echo "The following files are not properly formatted:"
echo "$fmt_issues"
echo "Please run 'gofmt -w .' in the respective module directories to format your code."
exit 1
fi