forked from quic-go/quic-go
run golangci-lint on Github Actions instead of Travis
This commit is contained in:
13
.github/workflows/lint.yml
vendored
Normal file
13
.github/workflows/lint.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Check that no non-test files import Ginkgo or Gomega
|
||||
run: .github/workflows/no_ginkgo.sh
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v1
|
||||
with:
|
||||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
||||
version: v1.30
|
||||
24
.github/workflows/no_ginkgo.sh
vendored
Executable file
24
.github/workflows/no_ginkgo.sh
vendored
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Verify that no non-test files import Ginkgo or Gomega.
|
||||
|
||||
set -e
|
||||
|
||||
HAS_TESTING=false
|
||||
|
||||
cd ..
|
||||
for f in $(find . -name "*.go" ! -name "*_test.go"); do
|
||||
if grep -q "github.com/onsi/ginkgo" $f; then
|
||||
echo "$f imports github.com/onsi/ginkgo"
|
||||
HAS_TESTING=true
|
||||
fi
|
||||
if grep -q "github.com/onsi/gomega" $f; then
|
||||
echo "$f imports github.com/onsi/gomega"
|
||||
HAS_TESTING=true
|
||||
fi
|
||||
done
|
||||
|
||||
if "$HAS_TESTING"; then
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
Reference in New Issue
Block a user