|
| 1 | +name: check |
| 2 | + |
| 3 | +on: |
| 4 | + push: { } |
| 5 | + pull_request: { } |
| 6 | + |
| 7 | +concurrency: |
| 8 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }} |
| 9 | + cancel-in-progress: true |
| 10 | + |
| 11 | +jobs: |
| 12 | + |
| 13 | + go-mod: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v2 |
| 17 | + - name: Set up Go |
| 18 | + uses: actions/setup-go@v2.1.3 |
| 19 | + with: |
| 20 | + go-version: 1.15.7 |
| 21 | + - uses: actions/cache@v2 |
| 22 | + with: |
| 23 | + path: ~/go/pkg/mod |
| 24 | + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| 25 | + restore-keys: | |
| 26 | + ${{ runner.os }}-go- |
| 27 | + - name: Check module vendoring |
| 28 | + run: | |
| 29 | + go mod tidy |
| 30 | + go mod vendor |
| 31 | + git diff --exit-code || (echo "please run 'go mod tidy && go mod vendor', and submit your changes"; exit 1) |
| 32 | +
|
| 33 | + golangci-lint: |
| 34 | + runs-on: ubuntu-latest |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v2 |
| 37 | + - name: Set up Go |
| 38 | + uses: actions/setup-go@v2.1.3 |
| 39 | + with: |
| 40 | + go-version: 1.15.7 |
| 41 | + - name: Run golangci-lint |
| 42 | + uses: golangci/golangci-lint-action@v2.5.2 |
| 43 | + with: |
| 44 | + version: v1.39.0 |
| 45 | + args: --timeout 300s --skip-dirs-use-default -v -E goconst -E gofmt -E ineffassign -E goimports -E revive -E misspell -E vet -E deadcode |
| 46 | + |
| 47 | + go-test: |
| 48 | + runs-on: ubuntu-latest |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v2 |
| 51 | + - name: Set up Go |
| 52 | + uses: actions/setup-go@v2.1.3 |
| 53 | + with: |
| 54 | + go-version: 1.15.7 |
| 55 | + - uses: actions/cache@v2 |
| 56 | + with: |
| 57 | + path: ~/go/pkg/mod |
| 58 | + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| 59 | + restore-keys: | |
| 60 | + ${{ runner.os }}-go- |
| 61 | + - name: Test |
| 62 | + run: | |
| 63 | + go test -v ./... |
| 64 | + go test -race -v ./... |
| 65 | +
|
| 66 | + shellcheck: |
| 67 | + runs-on: ubuntu-latest |
| 68 | + steps: |
| 69 | + - uses: actions/checkout@v2 |
| 70 | + - name: Run ShellCheck |
| 71 | + uses: ludeeus/action-shellcheck@1.1.0 |
| 72 | + env: |
| 73 | + SHELLCHECK_OPTS: -e SC2236,SC2162,SC2268 |
| 74 | + with: |
| 75 | + ignore: tests |
| 76 | + |
| 77 | + super-linter: |
| 78 | + runs-on: ubuntu-latest |
| 79 | + steps: |
| 80 | + - uses: actions/checkout@v2 |
| 81 | + - name: Lint Code Base |
| 82 | + uses: github/super-linter@v4.5.1 |
| 83 | + env: |
| 84 | + VALIDATE_ALL_CODEBASE: true |
| 85 | + VALIDATE_MARKDOWN: true |
| 86 | + LINTER_RULES_PATH: .github |
| 87 | + MARKDOWN_CONFIG_FILE: .markdown-lint.yml |
| 88 | + VALIDATE_MD: true |
| 89 | + DEFAULT_BRANCH: main |
| 90 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 91 | + FILTER_REGEX_EXCLUDE: .github/.* |
0 commit comments