Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ concurrency:
cancel-in-progress: false

jobs:
test:
check:
name: Test
uses: ./.github/workflows/test.yml
uses: ./.github/workflows/check.yml
build:
name: Build
needs: test
needs: check
runs-on: ubuntu-latest
permissions:
actions: write
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
on: [workflow_call]
name: "Check"
permissions: {}

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up Go
uses: actions/setup-go@v5
with:
cache: false
go-version: '1.21.5'

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
working-directory: src
args: --out-format=colored-line-number

- name: Run staticcheck
uses: dominikh/staticcheck-action@v1
with:
version: latest
install-go: false
working-directory: src

- name: Run Go vet
run: go vet ./...
working-directory: src
43 changes: 11 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,15 @@
on: [workflow_call, workflow_dispatch]
on:
workflow_dispatch:
pull_request:
paths:
- '**/*.go'
- '.github/workflows/test.yml'
- '.github/workflows/check.yml'

name: "Test"
permissions: {}

jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up Go
uses: actions/setup-go@v5
with:
cache: false
go-version: '1.21.5'

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
working-directory: src
args: --out-format=colored-line-number

- name: Run staticcheck
uses: dominikh/staticcheck-action@v1
with:
version: latest
install-go: false
working-directory: src

- name: Run Go vet
run: go vet ./...
working-directory: src
check:
name: Test
uses: ./.github/workflows/check.yml