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

69 lines
1.3 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:
2024-01-05 04:36:05 +01:00
paths-ignore:
- '**.yml'
2023-04-26 23:20:06 +02:00
jobs:
2023-09-17 02:55:17 +02:00
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
2024-05-05 00:38:06 +02:00
- name: Set up Go 1.22
2023-09-17 02:55:17 +02:00
uses: actions/setup-go@v4
with:
2024-05-05 00:38:06 +02:00
go-version: "1.22"
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
2024-05-05 00:38:06 +02:00
- name: Set up Go 1.22
2023-09-17 02:55:17 +02:00
uses: actions/setup-go@v4
with:
2024-05-05 00:38:06 +02:00
go-version: "1.22"
2023-09-17 02:55:17 +02:00
2024-05-11 21:02:57 +02:00
- name: Check Go modules
2023-09-17 02:55:17 +02:00
run: make go_mod check_changes
2024-05-11 21:02:57 +02:00
- name: Check translations
run: make check-tr
2023-09-17 02:55:17 +02:00
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"]
2024-05-05 00:38:06 +02:00
go: ["1.22"]
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