-
Notifications
You must be signed in to change notification settings - Fork 12
89 lines (83 loc) · 2.67 KB
/
_main.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
name: PR tests
on:
pull_request:
branches: [ "main" ]
paths-ignore:
- '**.md'
jobs:
build:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
config: ${{ steps.filter.outputs.config }}
milestone: ${{ steps.filter.outputs.milestone }}
labels: ${{ steps.filter.outputs.labels }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
config:
- "pkg/config/config.yaml"
milestone:
- "cmd/milestones/**"
labels:
- "cmd/labels/**"
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
- run: go install github.com/rhysd/actionlint/cmd/actionlint@latest
- run: |
GOPATH="$(go env GOPATH)"
export PATH="${PATH}:${GOPATH}/bin"
actionlint
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
- run: go test ./...
check-milestones:
needs: build
if: ${{ needs.build.outputs.config == 'true' || needs.build.outputs.milestone == 'true' }}
runs-on: ubuntu-latest
permissions: read-all
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
# - name: Get Token
# id: get_workflow_token
# uses: peter-murray/workflow-application-token-action@v3
# with:
# application_id: ${{ vars.KONVEYOR_BOT_ID }}
# application_private_key: ${{ secrets.KONVEYOR_BOT_KEY }}
# - env:
# GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
# run: go run cmd/milestones/main.go -config pkg/config/config.yaml
- run: go run cmd/milestones/main.go -config pkg/config/config.yaml -log-level 8
check-labels:
needs: build
if: ${{ needs.build.outputs.config == 'true' || needs.build.outputs.milestone == 'true' }}
runs-on: ubuntu-latest
permissions: read-all
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
# - name: Get Token
# id: get_workflow_token
# uses: peter-murray/workflow-application-token-action@v3
# with:
# application_id: ${{ vars.KONVEYOR_BOT_ID }}
# application_private_key: ${{ secrets.KONVEYOR_BOT_KEY }}
# - env:
# GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
# run: go run cmd/labels/main.go -config pkg/config/config.yaml
- run: go run cmd/labels/main.go -config pkg/config/config.yaml