Skip to content

chore(v0.5.0): feature sync and pipeline fixes #29

chore(v0.5.0): feature sync and pipeline fixes

chore(v0.5.0): feature sync and pipeline fixes #29

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches:
- main
- feature/**
jobs:
test:
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
cache: true
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: task init
- name: Run tests
run: task test
- name: Run unit tests
run: task test:unit
- name: Run integration tests
run: task test:integration
- name: Generate coverage report
run: task test:coverage
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
file: ./coverage.txt
fail_ci_if_error: true
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
cache: true
- name: Install Task
uses: arduino/setup-task@v2
- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/cmd/[email protected]
- name: Run linters
run: task lint
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: ./...
- name: Run nancy for dependency scanning
uses: sonatype-nexus-community/nancy-github-action@main
build:
name: Build
runs-on: ubuntu-latest
needs: [test, lint, security]
strategy:
matrix:
os: [linux, darwin, windows]
arch: [amd64, arm64]
exclude:
- os: windows
arch: arm64
- os: linux
arch: arm64
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
cache: true
- name: Install Task
uses: arduino/setup-task@v2
- name: Build
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
run: task build
- name: Test binary
if: matrix.os != 'windows'
run: ./bin/1ctl --version
- name: Test binary (Windows)
if: matrix.os == 'windows'
run: ./bin/1ctl.exe --version