yanic/.github/workflows/go.yml

66 lines
1.5 KiB
YAML
Raw Normal View History

2022-03-28 03:42:42 +02:00
name: Test, Lint
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
2023-09-18 10:55:05 +02:00
go-version: [1.21]
2022-03-28 03:42:42 +02:00
steps:
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ matrix.go-version }}-go-
- name: Run tests
run: make test
- uses: codecov/codecov-action@v2
with:
file: coverage.out
lint:
runs-on: ubuntu-latest
strategy:
matrix:
2023-09-18 10:55:05 +02:00
go-version: [1.21]
2022-03-28 03:42:42 +02:00
steps:
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ matrix.go-version }}-go-
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: latest
skip-cache: true