Files
github-to-signal/.github/workflows/ci.yaml

67 lines
1.5 KiB
YAML

name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
env:
GOPRIVATE: github.com/taigrr/*
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Configure private modules
run: git config --global url."https://${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/"
- name: Check goimports
run: |
go install golang.org/x/tools/cmd/goimports@latest
diff <(goimports -l .) <(echo -n)
- name: Run staticcheck
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck ./...
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Configure private modules
run: git config --global url."https://${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/"
- name: Run tests
run: go test -race -v ./...
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Configure private modules
run: git config --global url."https://${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/"
- name: Build
run: go build -v ./...