mirror of
https://github.com/thomiceli/opengist.git
synced 2025-01-05 17:02:39 +00:00
Adding Golang CI
This commit is contained in:
parent
91db4dcd30
commit
fe19e64dd4
1 changed files with 49 additions and 0 deletions
49
.github/workflows/go.yml
vendored
Normal file
49
.github/workflows/go.yml
vendored
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
name: "Go"
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: ["ubuntu-latest", "macOS-latest"]
|
||||||
|
go: ["1.19", "1.20"]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Set up Go ${{ matrix.go }}
|
||||||
|
uses: WillAbides/setup-go-faster@v1.8.0
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.go }}
|
||||||
|
|
||||||
|
- name: Cache Go modules
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
|
||||||
|
- name: Cache Go build cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/.cache/go-build
|
||||||
|
key: ${{ runner.os }}-go-build-${{ matrix.go }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-build-
|
||||||
|
|
||||||
|
- name: Run go vet
|
||||||
|
run: "go vet ./..."
|
||||||
|
|
||||||
|
- name: Run Staticcheck
|
||||||
|
uses: dominikh/staticcheck-action@v1.3.0
|
||||||
|
with:
|
||||||
|
version: "2023.1.1"
|
||||||
|
install-go: false
|
||||||
|
cache-key: ${{ matrix.go }}
|
Loading…
Reference in a new issue