Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
name: Build, test, lint, and scan
Expand All @@ -21,10 +25,10 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@v7
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Set up Go
uses: actions/setup-go@v6
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ matrix.go == '1.27rc1' && '1.27.0-rc.1' || format('{0}.x', matrix.go) }}
allow-prereleases: true
Expand All @@ -34,34 +38,45 @@ jobs:
run: go mod download

- name: Run golangci-lint
continue-on-error: true
uses: golangci/golangci-lint-action@v9
if: matrix.go != '1.27rc1'
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
with:
version: v2.12.2

- name: Run tests
run: go test -v -coverprofile=coverage.txt ./...
run: go test -race -v -coverprofile=coverage.txt ./...

- name: Show coverage summary
run: go tool cover -func=coverage.txt | tail -1

- name: Upload coverage report
if: matrix.go == '1.26'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-report
path: coverage.txt
retention-days: 30
if-no-files-found: error

- name: Build plugin binary
run: go build -v ./cmd/plugin

- name: Run Trivy filesystem scan
uses: aquasecurity/trivy-action@v0.36.0
if: matrix.go == '1.26'
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
scan-type: fs
scan-ref: .
format: table
exit-code: '1'
ignore-unfixed: true
severity: CRITICAL,HIGH

actionlint:
name: Validate GitHub Actions
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Run actionlint
uses: reviewdog/action-actionlint@6fb7acc99f4a1008869fa8a0f09cfca740837d9d # v1.72.0
Loading
Loading