-
Notifications
You must be signed in to change notification settings - Fork 6
107 lines (94 loc) · 3.07 KB
/
ci_reuse_go_pr.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
name: CI - golang
on:
workflow_call:
inputs:
ignore_copyright:
required: false
type: string
test_folder:
required: false
type: string
ignore_bp3:
required: false
type: string
short_test:
required: false
type: string
running_workflow:
required: false
type: string
ignore_build:
required: false
type: string
go_race:
required: false
type: string
test_subfolders:
required: false
type: string
secrets:
reporeading_token:
required: true
codecov_token:
required: true
personal_token:
required: true
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
cache: false
# Install TinyGo
- name: Install TinyGo
run: |
wget https://github.com/tinygo-org/tinygo/releases/download/v0.34.0/tinygo_0.34.0_amd64.deb
sudo dpkg -i tinygo_0.34.0_amd64.deb
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Check pull request file size
run: curl -s https://raw.githubusercontent.com/untillpro/ci-action/master/scripts/checkPR.sh | bash
env:
token: ${{ secrets.reporeading_token }}
pr_number: ${{ github.event.number }}
- name: Check if another workflow running and cancel it
run: curl -s https://raw.githubusercontent.com/untillpro/ci-action/master/scripts/cancelworkflow.sh | bash
env:
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
repo: ${{ GITHUB.REPOSITORY }}
branch: ${{ github.event.pull_request.head.ref }}
runningworkflow: ${{ inputs.running_workflow }}
- name: Cache Go - Modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: CI
uses: untillpro/ci-action@master
with:
ignore: ${{ inputs.ignore_copyright }}
test-folder: ${{ inputs.test_folder }}
organization: 'untillpro,heeus'
token: ${{ secrets.reporeading_token }}
codecov-token: ${{ secrets.codecov_token }}
short-test: ${{ inputs.short_test }}
ignore-build: ${{ inputs.ignore_build }}
run-mod-tidy: false
- name: Test subfolders
if: ${{ inputs.test_subfolders == 'true' }}
run: |
curl -s https://raw.githubusercontent.com/untillpro/ci-action/master/scripts/test_subfolders.sh | bash -s "$(go env GOPATH)"
- name: Check copyright
run: curl -s https://raw.githubusercontent.com/untillpro/ci-action/master/scripts/check_copyright.sh | bash -s "$(go env GOPATH)"
- name: Linters
run: curl -s https://raw.githubusercontent.com/untillpro/ci-action/master/scripts/gbash.sh | bash -s "$(go env GOPATH)"
env:
testfolder: ${{ inputs.test_folder }}