linkerd2/.github/workflows/static_checks.yml

96 lines
2.5 KiB
YAML

name: Static checks
on:
pull_request: {}
push:
paths-ignore:
- '*.md'
- '**/*.md'
branches:
- master
jobs:
go_dependencies:
name: Go dependencies
runs-on: ubuntu-18.04
steps:
- name: Checkout code
# actions/checkout@v2
uses: actions/checkout@722adc6
- name: Dump env
run: env | sort
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump job context
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
- name: Validate go deps
run: |
. bin/_tag.sh
for f in $( grep -lR --include=Dockerfile\* go-deps: . ) ; do
validate_go_deps_tag $f
done
go_lint:
name: Go lint
runs-on: ubuntu-18.04
container:
image: golang:1.13.4
steps:
- name: Checkout code
# actions/checkout@v2
uses: actions/checkout@722adc6
- name: Go lint
env:
GITCOOKIE_SH: ${{ secrets.GITCOOKIE_SH }}
run: |
echo "$GITCOOKIE_SH" | bash
bin/lint --verbose
go_format:
name: Go format
runs-on: ubuntu-18.04
container:
image: golang:1.13.4
steps:
- name: Checkout code
# actions/checkout@v2
uses: actions/checkout@722adc6
- name: Format
env:
GITCOOKIE_SH: ${{ secrets.GITCOOKIE_SH }}
run: |
echo "$GITCOOKIE_SH" | bash
bin/fmt
shellcheck:
name: shellcheck
runs-on: ubuntu-18.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: shellcheck
# TODO: Each file listed here is excluded from shellcheck because it
# fails. As we fix files we can remove them from this list.
#
# Once we have this list paired down signficantly, we can switch to
# disabling specific checks across all files, for example:
# bin/shellcheck bin/* --exclude=SC1000
#
# For more information on shellcheck failures:
# https://github.com/koalaman/shellcheck/wiki/Checks
run: |
find ./bin -type f \
! -name docker-build-proxy \
! -name _docker.sh \
! -name fmt \
! -name lint \
! -name _log.sh \
! -name minikube-start-hyperv.bat \
! -name _tag.sh \
! -name test-cleanup \
! -name test-clouds \
! -name _test-run.sh \
! -name update-go-deps-shas \
! -name *.nuspec \
! -name *.ps1 \
| xargs -I {} bin/shellcheck -x -P ./bin {}