Skip to content

Commit

Permalink
ci: refactor GitHub Actions workflows for improved efficiency
Browse files Browse the repository at this point in the history
- Add a GitHub Actions workflow for Bearer PR Check
- Add Bearer action to Go workflow
- Remove macOS from Go workflow operating systems
- Remove redundant checkout step from Go workflow

Signed-off-by: Bo-Yi Wu <[email protected]>
  • Loading branch information
appleboy committed Dec 31, 2024
1 parent f8a6bb0 commit b0e321a
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/bearer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Bearer PR Check

on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read
pull-requests: write

jobs:
rule_check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest

- name: Run Report
id: report
uses: bearer/bearer-action@v2
with:
format: rdjson
output: rd.json
diff: true

- name: Run reviewdog
if: always()
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cat rd.json | reviewdog -f=rdjson -reporter=github-pr-review
16 changes: 11 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,32 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v5
with:
go-version: "^1"
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --verbose

- name: Bearer
uses: bearer/bearer-action@v2
with:
diff: true

test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
go: [1.21, 1.22, 1.23]
include:
- os: ubuntu-latest
go-build: ~/.cache/go-build
- os: macos-latest
go-build: ~/Library/Caches/go-build
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
runs-on: ${{ matrix.os }}
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
with:
go-version-file: go.mod
check-latest: true

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
Expand Down

0 comments on commit b0e321a

Please sign in to comment.