mirror of
https://github.com/rodneyosodo/kopokopo-go.git
synced 2026-06-23 04:10:10 +00:00
ee1c557ea7
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
61 lines
1.5 KiB
YAML
61 lines
1.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
|
|
ci:
|
|
strategy:
|
|
matrix:
|
|
go-version: [1.17.x, 1.18.x]
|
|
os: [ubuntu-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Verify dependencies
|
|
run: go mod verify
|
|
|
|
- name: Run go vet
|
|
run: go vet ./...
|
|
|
|
- name: Build
|
|
run: go build -v ./...
|
|
|
|
- name: Lint with golangci-lint
|
|
run: |
|
|
export GOBIN=$HOME/go/bin
|
|
echo $(go env GOBIN)
|
|
export PATH=$PATH:$(go env GOBIN)
|
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOBIN) v1.46.2
|
|
echo "Running lint..."
|
|
golangci-lint run --no-config --disable-all --enable gosimple --enable govet --enable unused --enable deadcode --timeout 3m
|
|
|
|
|
|
- name: Install golint
|
|
run: go install golang.org/x/lint/golint@latest
|
|
|
|
- name: Run golint
|
|
run: golint ./...
|
|
|
|
- name: Run tests
|
|
run: go test -mod=vendor -v -vet=off -covermode=count -coverprofile cover.out ./...
|
|
# - name: Convert coverage.out to coverage.lcov
|
|
# uses: jandelgado/gcov2lcov-action@v1.0.6
|
|
# - name: Coveralls
|
|
# uses: coverallsapp/github-action@v1.1.2
|
|
# with:
|
|
# github-token: ${{ secrets.github_token }}
|
|
# path-to-lcov: coverage.lcov
|