Skip to content

Commit 4b6f3d2

Browse files
authored
Merge pull request #26 from aereal/update-workflow
ci: update workflow
2 parents 083699c + fc661ce commit 4b6f3d2

File tree

7 files changed

+81
-17
lines changed

7 files changed

+81
-17
lines changed

.github/workflows/ci.yml

+34-16
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,30 @@
33
name: CI
44
on:
55
pull_request:
6-
push:
7-
branches:
8-
- main
96
jobs:
107
ok:
118
if: failure()
12-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-24.04
1310
needs:
14-
- test
15-
- lint
11+
- test-lint
1612
steps:
1713
- run: exit 1
18-
test:
14+
test-lint:
15+
name: test and lint
1916
strategy:
2017
matrix:
2118
go_version:
2219
- stable
2320
- oldstable
24-
runs-on: ubuntu-latest
21+
runs-on: ubuntu-24.04
22+
permissions:
23+
actions: read
24+
contents: read
25+
pull-requests: write
2526
steps:
2627
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2728
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
29+
id: setup-go
2830
with:
2931
go-version: ${{ matrix.go_version }}
3032
cache: true
@@ -33,12 +35,28 @@ jobs:
3335
go test -v -race -coverprofile=cover.out ./...
3436
- uses: k1LoW/octocov-action@1ad702b3118b6a055c00b01db68ca0d9f6641dbc # v1.4.0
3537
if: ${{ matrix.go_version == 'stable' }}
36-
lint:
37-
runs-on: ubuntu-latest
38-
steps:
39-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40-
- name: lint
41-
uses: reviewdog/action-golangci-lint@dd3fda91790ca90e75049e5c767509dc0ec7d99b # v2.7.0
38+
- uses: aquaproj/aqua-installer@e2d0136abcf70b7a2f6f505720640750557c4b33 # v3.1.1
4239
with:
43-
fail_level: warning
44-
filter_mode: nofilter
40+
aqua_version: v2.43.3
41+
- run: aqua install
42+
- name: golangci-lint
43+
env:
44+
_go_version: ${{ steps.setup-go.outputs.go-version }}
45+
run: |
46+
golangci-lint run \
47+
--go "$_go_version" \
48+
--out-format line-number \
49+
--issues-exit-code 0 \
50+
--config .golangci.yml \
51+
1>lint-stdout.txt 2>/dev/stderr
52+
- name: reviewdog
53+
env:
54+
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
55+
run: |
56+
reviewdog \
57+
-name golangci-lint \
58+
-f golangci-lint \
59+
-filter-mode nofilter \
60+
-reporter github-pr-check \
61+
-fail-level warning \
62+
< lint-stdout.txt

.github/workflows/release.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: release
3+
on:
4+
push:
5+
branches:
6+
- main
7+
jobs:
8+
tagpr:
9+
runs-on: ubuntu-24.04
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
steps:
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
with:
16+
token: ${{ secrets.TAGPR_GITHUB_PAT }}
17+
- uses: aquaproj/aqua-installer@e2d0136abcf70b7a2f6f505720640750557c4b33 # v3.1.1
18+
with:
19+
aqua_version: v2.43.3
20+
- run: aqua install
21+
- name: run tagpr
22+
run: tagpr
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.TAGPR_GITHUB_PAT }}

.golangci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ linters:
2626
- protogetter
2727
- reassign
2828
- staticcheck
29-
- tenv
3029
- testableexamples
3130
- testpackage
3231
- thelper
3332
- tparallel
3433
- unused
34+
- usetesting
3535
linters-settings:
3636
errcheck:
3737
check-type-assertions: true

.tagpr

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[tagpr]
2+
vPrefix = true
3+
releaseBranch = main
4+
versionFile = version.txt
5+
release = true
6+
commitPrefix = "chore(tagpr): "

aqua-policy.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/aquaproj/aqua/main/json-schema/policy.json
3+
registries:
4+
- type: standard
5+
ref: semver(">= 3.0.0")
6+
packages:
7+
- registry: standard

aqua.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/aquaproj/aqua/main/json-schema/aqua-yaml.json
3+
registries:
4+
- type: standard
5+
ref: v4.311.0 # renovate: depName=aquaproj/aqua-registry
6+
packages:
7+
- name: golangci/[email protected]
8+
- name: reviewdog/[email protected]

version.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v0.3.0

0 commit comments

Comments
 (0)