Run lint after tests instead of separate workflow (#2103)

This commit is contained in:
mmetc 2023-03-08 14:50:59 +01:00 committed by GitHub
parent e63a3ab92b
commit 137e7408fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 19 additions and 47 deletions

View file

@ -31,7 +31,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go
- name: "Check out CrowdSec repository"
uses: actions/checkout@v3

View file

@ -38,7 +38,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go
- name: "Check out CrowdSec repository"
uses: actions/checkout@v3

View file

@ -39,7 +39,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go
- name: "Check out CrowdSec repository"
uses: actions/checkout@v3

View file

@ -28,7 +28,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go
- name: "Check out CrowdSec repository"
uses: actions/checkout@v3

View file

@ -19,7 +19,6 @@ on:
- windows/installer/*.wxs
- .github/workflows/ci-windows-build-msi.yml
jobs:
build:
strategy:
@ -35,7 +34,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3

View file

@ -1,38 +0,0 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- master
- releases/**
paths-ignore:
- 'docs/**'
- 'mkdocs.yml'
- 'README.md'
pull_request:
paths-ignore:
- 'docs/**'
- 'mkdocs.yml'
- 'README.md'
jobs:
golangci:
strategy:
matrix:
os: [ubuntu-latest, windows-2022]
name: lint
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.20.1
id: go
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51
args: --issues-exit-code=1 --timeout 10m
only-new-issues: false

View file

@ -33,7 +33,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out CrowdSec repository
uses: actions/checkout@v3
@ -69,3 +68,10 @@ jobs:
with:
files: coverage.out
flags: unit-windows
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51
args: --issues-exit-code=1 --timeout 10m
only-new-issues: false

View file

@ -114,7 +114,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out CrowdSec repository
uses: actions/checkout@v3
@ -153,3 +152,10 @@ jobs:
with:
files: coverage.out
flags: unit-linux
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51
args: --issues-exit-code=1 --timeout 10m
only-new-issues: false

View file

@ -15,11 +15,12 @@ jobs:
name: Build and upload binary package
runs-on: ubuntu-latest
steps:
- name: "Set up Go ${{ matrix.go-version }}"
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
@ -51,6 +52,7 @@ jobs:
strategy:
matrix:
go-version: ["1.20.1"]
name: Build and upload binary package
runs-on: ubuntu-latest
steps:
@ -59,6 +61,7 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
@ -81,6 +84,7 @@ jobs:
run: |
make release BUILD_STATIC=yes
mv crowdsec-release.tgz crowdsec-release-static.tgz
- name: Upload to release
uses: JasonEtco/upload-to-release@master
with: