这是indexloc提供的服务,不要输入任何密码
Skip to content

Merge pull request #15 from gosuda/feature/remove-cobra #93

Merge pull request #15 from gosuda/feature/remove-cobra

Merge pull request #15 from gosuda/feature/remove-cobra #93

Workflow file for this run

name: CI
on:
pull_request:
branches: [ main, master ]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "stable"
check-latest: true
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
- name: Install protobuf compiler
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Install protoc-gen-go and protoc-gen-go-vtproto
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@latest
- name: Generate protobuf files
run: make build-protoc
- name: Run tests
run: go test -v -race -coverprofile=coverage.out ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.out
flags: unittests
name: codecov-umbrella
build:
name: Build
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "stable"
check-latest: true
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler binaryen
- name: Install protoc-gen-go and protoc-gen-go-vtproto
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@latest
- name: Build all components
run: make build
- name: Build Docker image
run: |
docker build -t relaydns:test .
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "stable"
check-latest: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v8

Check failure on line 118 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

You have an error in your yaml syntax on line 118
with:
version: v2.6.0