mirror of
https://github.com/boolean-maybe/tiki
synced 2026-04-21 13:37:20 +00:00
86 lines
1.7 KiB
YAML
86 lines
1.7 KiB
YAML
name: Go
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
go-version: ['1.24.x']
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
cache: true
|
|
|
|
- name: Download dependencies
|
|
run: go mod download
|
|
|
|
- name: Verify dependencies
|
|
run: go mod verify
|
|
|
|
- name: Run tests
|
|
shell: bash
|
|
run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
|
|
|
|
- name: Upload coverage to Codecov
|
|
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.24.x'
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
files: ./coverage.out
|
|
flags: unittests
|
|
fail_ci_if_error: false
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24.x'
|
|
cache: true
|
|
|
|
- name: Run golangci-lint
|
|
uses: golangci/golangci-lint-action@v7
|
|
with:
|
|
version: v2.8.0
|
|
args: --timeout=5m
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24.x'
|
|
cache: true
|
|
|
|
- name: Build
|
|
run: go build -v .
|
|
|
|
- name: Check go mod tidiness
|
|
run: |
|
|
go mod tidy
|
|
git diff --exit-code go.mod go.sum
|