Skip to content

fix: resolve sec scan warnings and add Windows test compat #31

fix: resolve sec scan warnings and add Windows test compat

fix: resolve sec scan warnings and add Windows test compat #31

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: Generate coverage report
run: task test:coverage
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/v2/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: ./...
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