gosec/.github/workflows/ci.yml

65 lines
1.7 KiB
YAML
Raw Normal View History

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
strategy:
matrix:
version: [{go: '1.21.9', golangci: 'latest'}, {go: '1.22.2', golangci: 'latest'}]
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Setup go ${{ matrix.version.go }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.version.go }}
- name: Checkout Source
uses: actions/checkout@v4
2024-01-22 01:36:12 +00:00
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: lint
2024-04-30 04:45:33 +01:00
uses: golangci/golangci-lint-action@v5
with:
version: ${{ matrix.version.golangci }}
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: ./...
- name: Run Tests
run: make test
coverage:
needs: [test]
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: '1.22.2'
- name: Checkout Source
uses: actions/checkout@v4
2024-01-22 01:36:12 +00:00
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Create Test Coverage
run: make test-coverage
- name: Upload Test Coverage
2024-02-05 01:32:00 +00:00
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true