-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (149 loc) · 4.93 KB
/
workflows.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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Unified Workflows
on:
pull_request:
branches: [ 'main' ]
workflow_dispatch:
permissions:
actions: "read"
issues: "write"
checks: "write"
security-events: "write"
pull-requests: "write"
contents: "write"
jobs:
workflows:
runs-on: "ubuntu-latest"
permissions:
actions: "read"
issues: "write"
checks: "write"
security-events: "write"
pull-requests: "write"
contents: "write"
steps:
# https://github.com/Codium-ai/pr-agent
- name: 'PR Agent action step'
id: pragent
uses: Codium-ai/pr-agent@main
env:
OPENAI_KEY: "${{ secrets.OPENAI_KEY }}"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
OPENAI.ORG: "${{ secrets.OPENAI_ORG }}"
PR_REVIEWER.REQUIRE_TESTS_REVIEW: "false" # Disable tests review
PR_CODE_SUGGESTIONS.NUM_CODE_SUGGESTIONS: 20
# https://github.com/amannn/action-semantic-pull-request
- name: 'Semantic Pull Requests'
uses: amannn/action-semantic-pull-request@main
continue-on-error: true
env:
GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"
with:
wip: true
types: |
fix
feat
docs
perf
refactor
revert
test
scopes: |
core
ui
JIRA-\d+
requireScope: true
disallowScopes: |
release
[A-Z]+
algo
database
logger
subjectPattern: ^(?![A-Z]).+$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
doesn't start with an uppercase character.
githubBaseUrl: https://github.com/shashank-priyadarshi/utils
ignoreLabels: |
bot
ignore-semantic-pull-request
headerPattern: '^(\w*)(?:\(([\w$.\-*/ ]*)\))?: (.*)$'
headerPatternCorrespondence: type, scope, subject
# https://github.com/actions/dependency-review-action
- name: 'Checkout Repository'
uses: actions/checkout@main
with:
fetch-depth: 0
- name: 'Install Go 1.23'
uses: actions/setup-go@main
with:
go-version: 1.23
- name: 'Refresh deps for CI'
run: |
go env -w GONOSUMDB=go.ssnk.in
go mod download
go mod tidy
- name: 'Cache Go Modules'
uses: actions/cache@main
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: 'Run tests'
continue-on-error: true
run: |
go test -json `go list ./... | grep -v directoriesToSkip` > test_report.out
go test -coverprofile=coverage.out `go list ./... | grep -v directoriesToSkip`
- name: 'Run golangci-lint'
uses: golangci/golangci-lint-action@master
with:
version: latest
args: --config .github/.golangci.yaml --out-format json ./... > external_issues.json
- name: 'Analyze with SonarQube'
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
SONAR_TOKEN: "${{ secrets.SONAR_TOKEN }}"
SONAR_HOST_URL: "${{ secrets.SONAR_HOST_URL }}"
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
with:
args:
-Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }}
-Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }}
-Dsonar.projectVersion=$RELEASE_VERSION
- name: 'Upload coverage reports to Codecov'
uses: codecov/codecov-action@main
with:
token: "${{ secrets.CODECOV_TOKEN }}"
slug: shashank-priyadarshi/utils
- name: 'Dependency Review'
uses: actions/dependency-review-action@main
with:
base-ref: dev
head-ref: main
comment-summary-in-pr: always
allow-licenses: GPL-3.0, BSD-3-Clause, MIT
warn-only: true
# https://github.com/actions/labeler
- name: 'Labeler'
uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
# https://github.com/actions/stale
- name: 'Stale manager'
uses: actions/stale@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
# https://github.com/goreleaser/goreleaser
- uses: go-semantic-release/action@master
with:
hooks: goreleaser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}