Introduce static code analysis #97
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
pull-requests: read | |
actions: read | |
security-events: write | |
packages: write | |
concurrency: | |
group: build-test-ci-${{ github.ref }}-1 | |
cancel-in-progress: true | |
jobs: | |
go-build-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 'stable' | |
- name: Build | |
run: make build | |
- name: Test | |
run: make test | |
go-analyse: | |
needs: go-build-test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 'stable' | |
- name: Docker cache | |
uses: ScribeMD/[email protected] | |
with: | |
key: docker-${{ runner.os }}-${{ hashFiles('Makefile') }}} | |
- name: Lint | |
run: make lint | |
- name: Gosec | |
run: make gosec | |
- name: Nilcheck | |
run: make nilcheck | |
- name: Vulncheck | |
run: make vulncheck | |
docker-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache Docker images. | |
uses: ScribeMD/[email protected] | |
with: | |
key: docker-${{ runner.os }}-${{ hashFiles('Dockerfile') }} | |
- name: Build the Docker image | |
run: make docker-build |