46 lines
1.1 KiB
Plaintext
46 lines
1.1 KiB
Plaintext
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [ main ]
|
|
workflow_call:
|
|
|
|
jobs:
|
|
lint-test:
|
|
name: CI (Lint, Test)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check for [noci] in commit message
|
|
id: check_commit
|
|
run: |
|
|
if [[ "${{ github.event.head_commit.message }}" == "[noci]"* ]]; then
|
|
echo "skip=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "skip=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Checkout code
|
|
if: steps.check_commit.outputs.skip != 'true'
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
if: steps.check_commit.outputs.skip != 'true'
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.23'
|
|
|
|
- name: Download dependencies
|
|
if: steps.check_commit.outputs.skip != 'true'
|
|
run: go mod download
|
|
|
|
- name: Run golangci-lint
|
|
if: steps.check_commit.outputs.skip != 'true'
|
|
uses: golangci/golangci-lint-action@v6
|
|
with:
|
|
version: latest
|
|
args: --timeout=5m
|
|
|
|
- name: Run tests
|
|
if: steps.check_commit.outputs.skip != 'true'
|
|
run: go test -race ./...
|