-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (78 loc) · 2.28 KB
/
pr_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
# This workflow will build and test a golang project
name: PR CI
run-name: "CI pipeline for PR - (#${{ github.event.number }}) ${{ github.event.pull_request.title }}"
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
ci:
name: Continuous integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Download Go dependencies
run: go get ./... && go mod tidy
- name: Check if all dependencies were commited
shell: bash
run: |
if [ "$(git status --porcelain)" ]; then
git status
exit 1
else
exit 0
fi
- name: Build codegen
run: go build -v ./...
- name: Test codegen
run: go test -v ./...
generate:
needs: ci
name: Generate code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: Set up Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5
with:
go-version: "1.22"
- name: Download Go dependencies
run: go get ./... && go mod tidy
- name: Build codegen
run: go build -v ./...
- name: Execute codegen for PANGO SDK
run: go run cmd/codegen/main.go -t mksdk
- name: List generated PANGO SDK files
run: |
echo "Generated Files:"
ls ../generated/pango
- name: Workaround actions/upload-artifact#176
run: |
echo "artifacts_path=$(realpath ../generated/pango)" >> $GITHUB_ENV
- name: Upload generated files for PANGO SDK
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
with:
name: generated-pango
path: |
${{ env.artifacts_path }}
retention-days: 3
if-no-files-found: error