watchtower/.github/workflows/pull-request.yml
Step Security Bot 9a2f9c48c7
[StepSecurity] ci: Harden GitHub Actions (#1426)
Co-authored-by: nils måsén <nils@piksel.se>
2022-10-16 14:13:42 +02:00

69 lines
1.6 KiB
YAML

name: Pull Request
on:
workflow_dispatch: {}
pull_request:
branches:
- main
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
- uses: dominikh/staticcheck-action@a3513ade2e5cb8075ba1c1ed1890a989cf0f2aa0 #v1.2.0
with:
version: "2022.1.1"
test:
name: Test
strategy:
fail-fast: false
matrix:
go-version:
- 1.18.x
platform:
- macos-latest
- windows-latest
- ubuntu-latest
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
- name: Run tests
run: |
go test -v -coverprofile coverage.out -covermode atomic ./...
- name: Publish coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
- name: Build
uses: goreleaser/goreleaser-action@ff11ca24a9b39f2d36796d1fbd7a4e39c182630a #v3
with:
version: v0.155.0
args: --snapshot --skip-publish --debug