Skip to content

add ci.yml

add ci.yml #1

Workflow file for this run

name: ci
on:
pull_request:
branches: [ main ]
jobs:
style:
name: Style
runs-on: ubuntu-latest
env:
GOEXPERIMENT: rangefunc
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Test Format
run: test -z $(go fmt ./...)
- name: Test Lint
run: staticcheck ./...
tests:
name: Tests
runs-on: ubuntu-latest
env:
GOEXPERIMENT: rangefunc
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Install gosec
run: go install github.com/securego/gosec/v2/cmd/gosec@latest
- name: Tests
run: go test ./... -cover
- name: Security Test
run: gosec ./...