mirror of
https://github.com/foomo/gotsrpc.git
synced 2025-10-16 12:35:35 +00:00
chore: add checks
This commit is contained in:
parent
c6c51db32c
commit
2be499f668
65
.github/workflows/checks.yml
vendored
Normal file
65
.github/workflows/checks.yml
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
# This workflow runs all dockerfiles in this repo
|
||||
name: checks
|
||||
|
||||
on:
|
||||
# Triggers the workflow on push or pull request events but only for the main branch
|
||||
push:
|
||||
branches: [ v2 ]
|
||||
pull_request:
|
||||
branches: [ v2 ]
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
GO_VERSION: 1.19
|
||||
GOLANGCI_LINT_VERSION: v1.48
|
||||
|
||||
jobs:
|
||||
matrix:
|
||||
name: matrix
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
gomod: ${{ steps.gomod.outputs.matrix }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- id: gomod
|
||||
run: |
|
||||
matrix=$(find . -type f -name "go.mod" -print0 | xargs -0 -n1 dirname | sort --unique | jq -R -s -c 'split("\n")[:-1]')
|
||||
echo "${matrix}"
|
||||
echo "::set-output name=matrix::${matrix}"
|
||||
lint:
|
||||
name: lint
|
||||
needs: matrix
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
gomod: ${{ fromJson(needs.matrix.outputs.gomod) }}
|
||||
env:
|
||||
GOFLAGS: -mod=readonly
|
||||
GOPROXY: https://proxy.golang.org
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
- uses: golangci/golangci-lint-action@v3.2.0
|
||||
with:
|
||||
version: ${{ env.GOLANGCI_LINT_VERSION }}
|
||||
working-directory: ${{ matrix.gomod }}
|
||||
test:
|
||||
name: test
|
||||
needs: matrix
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
gomod: ${{ fromJson(needs.matrix.outputs.gomod) }}
|
||||
env:
|
||||
GOFLAGS: -mod=readonly
|
||||
GOPROXY: https://proxy.golang.org
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
- run: go test -v ./...
|
||||
|
||||
2
.github/workflows/goreleaser.yml
vendored
2
.github/workflows/goreleaser.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.17
|
||||
go-version: 1.19
|
||||
|
||||
- name: Unshallow
|
||||
run: git fetch --prune --unshallow
|
||||
|
||||
Loading…
Reference in New Issue
Block a user