opengist/.github/workflows/go.yml

64 lines
1.2 KiB
YAML
Raw Normal View History

2023-09-17 00:55:17 +00:00
name: "Go CI"
2023-04-26 21:20:06 +00:00
on:
push:
branches:
- master
2023-09-17 00:55:17 +00:00
- 'dev-*'
2023-04-26 21:20:06 +00:00
pull_request:
jobs:
2023-09-17 00:55:17 +00:00
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go 1.21
2023-09-17 00:55:17 +00:00
uses: actions/setup-go@v4
with:
go-version: "1.21"
2023-09-17 00:55:17 +00:00
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
skip-pkg-cache: true
args: --out-format=colored-line-number --timeout=20m
- name: Format
run: make fmt check_changes
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go 1.21
2023-09-17 00:55:17 +00:00
uses: actions/setup-go@v4
with:
go-version: "1.21"
2023-09-17 00:55:17 +00:00
- name: Check
run: make go_mod check_changes
test:
2023-04-26 21:20:06 +00:00
strategy:
fail-fast: false
matrix:
2023-09-17 00:55:17 +00:00
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
go: ["1.21"]
2023-04-26 21:20:06 +00:00
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
2023-04-26 21:55:37 +00:00
uses: actions/checkout@v3
2023-04-26 21:20:06 +00:00
- name: Set up Go ${{ matrix.go }}
2023-09-17 00:55:17 +00:00
uses: actions/setup-go@v4
2023-04-26 21:20:06 +00:00
with:
go-version: ${{ matrix.go }}
2023-09-17 00:55:17 +00:00
- name: Run tests
run: make test
2023-04-26 21:20:06 +00:00