1
0
Fork 0
mirror of https://github.com/thomiceli/opengist.git synced 2025-01-24 23:00:35 +00:00
opengist/.github/workflows/go.yml

64 lines
1.2 KiB
YAML
Raw Normal View History

2023-09-17 02:55:17 +02:00
name: "Go CI"
2023-04-26 23:20:06 +02:00
on:
push:
branches:
- master
2023-09-17 02:55:17 +02:00
- 'dev-*'
2023-04-26 23:20:06 +02:00
pull_request:
jobs:
2023-09-17 02:55:17 +02:00
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
2023-09-18 18:17:11 +02:00
- name: Set up Go 1.20
2023-09-17 02:55:17 +02:00
uses: actions/setup-go@v4
with:
2023-09-18 18:17:11 +02:00
go-version: "1.20"
2023-09-17 02:55:17 +02: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
2023-09-18 18:17:11 +02:00
- name: Set up Go 1.20
2023-09-17 02:55:17 +02:00
uses: actions/setup-go@v4
with:
2023-09-18 18:17:11 +02:00
go-version: "1.20"
2023-09-17 02:55:17 +02:00
- name: Check
run: make go_mod check_changes
test:
2023-04-26 23:20:06 +02:00
strategy:
fail-fast: false
matrix:
2023-09-17 02:55:17 +02:00
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
2023-09-18 18:17:11 +02:00
go: ["1.20", "1.21"]
2023-04-26 23:20:06 +02:00
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
2023-04-26 23:55:37 +02:00
uses: actions/checkout@v3
2023-04-26 23:20:06 +02:00
- name: Set up Go ${{ matrix.go }}
2023-09-17 02:55:17 +02:00
uses: actions/setup-go@v4
2023-04-26 23:20:06 +02:00
with:
go-version: ${{ matrix.go }}
2023-09-17 02:55:17 +02:00
- name: Run tests
run: make test
2023-04-26 23:20:06 +02:00