Some checks failed
SonarQube Scan / SonarQube Analysis (push) Failing after 1m13s
Co-authored-by: Copilot <copilot@github.com>
82 lines
1.8 KiB
YAML
82 lines
1.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- develop
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '1.23'
|
|
cache: true
|
|
|
|
- name: Run tests
|
|
run: go test -v -race -coverprofile=coverage.out ./src
|
|
|
|
- name: Upload coverage
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: coverage
|
|
path: coverage.out
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '1.23'
|
|
cache: true
|
|
|
|
- name: Install golangci-lint
|
|
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
|
|
|
- name: Run linter
|
|
run: golangci-lint run ./src
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
needs: [test, lint]
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '1.23'
|
|
cache: true
|
|
|
|
- name: Build binary (Linux)
|
|
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o epage-linux ./src
|
|
|
|
- name: Build binary (macOS)
|
|
run: CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o epage-macos ./src
|
|
|
|
- name: Build binary (Windows)
|
|
run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o epage-windows.exe ./src
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: binaries
|
|
path: |
|
|
epage-linux
|
|
epage-macos
|
|
epage-windows.exe
|