2023-06-08 14:44:53 +03:00
|
|
|
---
|
|
|
|
name: Go
|
2023-06-08 12:51:42 +03:00
|
|
|
on:
|
|
|
|
pull_request:
|
2023-06-08 14:44:53 +03:00
|
|
|
push:
|
2023-06-08 12:51:42 +03:00
|
|
|
branches:
|
|
|
|
- main
|
2023-08-11 13:27:52 +03:00
|
|
|
- "release-*"
|
2023-06-08 12:51:42 +03:00
|
|
|
|
2023-06-19 11:53:04 +03:00
|
|
|
# Minimal permissions to be inherited by any job that don't declare it's own permissions
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2023-06-08 12:51:42 +03:00
|
|
|
jobs:
|
|
|
|
test:
|
2023-06-08 14:44:53 +03:00
|
|
|
name: Tests
|
2023-06-08 12:51:42 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-08-11 13:27:52 +03:00
|
|
|
go_version: ["1.19", "1.20", "1.21"]
|
2023-06-08 12:51:42 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set up Go ${{ matrix.go_version }}
|
|
|
|
uses: actions/setup-go@v4
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go_version }}
|
|
|
|
|
|
|
|
- name: Cache Go modules
|
|
|
|
id: cache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
|
|
|
key: v1-go${{ matrix.go_version }}
|
|
|
|
|
|
|
|
- name: Run tests and check license
|
|
|
|
run: make check_license test
|
|
|
|
env:
|
|
|
|
CI: true
|
|
|
|
|
|
|
|
- name: Run style and unused
|
|
|
|
if: ${{ matrix.go_version == '1.20' }}
|
2023-06-19 11:53:04 +03:00
|
|
|
run: make style unused
|