59 lines
1.2 KiB
YAML
59 lines
1.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
container: golang:1.24.2-alpine
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download dependencies
|
|
run: go mod download
|
|
|
|
- name: Run tests
|
|
run: go test -v ./...
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
container: golang:1.24.2-alpine
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download dependencies
|
|
run: go mod download
|
|
|
|
- name: Build
|
|
run: |
|
|
go build -o bin/onx ./cmd/onx
|
|
go build -o bin/onxd ./cmd/onxd
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
container: golang:1.24.2-alpine
|
|
|
|
steps:
|
|
- name: Install git
|
|
run: apk add --no-cache git
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install golangci-lint
|
|
run: |
|
|
wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.62.0
|
|
|
|
- name: Run golangci-lint
|
|
run: $(go env GOPATH)/bin/golangci-lint run --timeout=2m |