-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (83 loc) · 2.61 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
name: ci
on:
pull_request:
types:
- opened
- synchronize
branches:
- main
jobs:
setup:
runs-on: ubuntu-latest
permissions:
actions: write
outputs:
comment-id: ${{ steps.setup.outputs.comment-id }}
steps:
- uses: daspn/private-actions-checkout@v2
id: actions
with:
actions_list: '["fluidtruck/github-actions-golang@v1"]'
app_id: ${{ secrets.PRIVATE_ACTIONS_APP_ID }}
app_private_key: ${{ secrets.PRIVATE_ACTIONS_KEY }}
return_app_token: true
- uses: ./.github/actions/github-actions-golang/actions/setup
id: setup
with:
app-token: ${{ steps.actions.outputs.app-token }}
lint:
runs-on: ubuntu-latest
permissions:
contents: read
needs: [setup]
steps:
- uses: actions/checkout@v3
- uses: daspn/private-actions-checkout@v2
id: actions
with:
actions_list: '["fluidtruck/github-actions-golang@v1"]'
app_id: ${{ secrets.PRIVATE_ACTIONS_APP_ID }}
app_private_key: ${{ secrets.PRIVATE_ACTIONS_KEY }}
- uses: ./.github/actions/github-actions-golang/actions/lint
with:
github-token: ${{ secrets.DEVBOT_GITHUB_TOKEN }}
go-version: 1.19
test:
runs-on: ubuntu-latest
permissions:
contents: read
needs: [lint]
outputs:
coverage: ${{ steps.test.outputs.coverage }}
steps:
- uses: actions/checkout@v3
- uses: daspn/private-actions-checkout@v2
id: actions
with:
actions_list: '["fluidtruck/github-actions-golang@v1"]'
app_id: ${{ secrets.PRIVATE_ACTIONS_APP_ID }}
app_private_key: ${{ secrets.PRIVATE_ACTIONS_KEY }}
- uses: ./.github/actions/github-actions-golang/actions/test
id: test
with:
github-token: ${{ secrets.DEVBOT_GITHUB_TOKEN }}
go-version: 1.19
preview:
runs-on: ubuntu-latest
permissions: {}
if: ${{ always() }}%
needs: [setup, test]
steps:
- uses: daspn/private-actions-checkout@v2
id: actions
with:
actions_list: '["fluidtruck/github-actions-golang@v1"]'
app_id: ${{ secrets.PRIVATE_ACTIONS_APP_ID }}
app_private_key: ${{ secrets.PRIVATE_ACTIONS_KEY }}
return_app_token: true
- uses: ./.github/actions/github-actions-golang/actions/preview
with:
app-token: ${{ steps.actions.outputs.app-token }}
comment-id: ${{ needs.setup.outputs.comment-id }}
coverage: ${{ needs.test.outputs.coverage }}
status: ${{ needs.deploy.result }}