[master] Update GitHub Actions (#332)

Copied from `https://github.com/knative/.github/tree/master/workflow-templates`.
/assign n3wscott vagababov
/cc n3wscott vagababov
This commit is contained in:
Matt Moore 2020-09-15 14:07:41 -07:00 committed by GitHub
parent 11799af7d8
commit 1070879d74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 50 additions and 4 deletions

View File

@ -47,8 +47,17 @@ jobs:
with:
fetch-depth: 1
- name: Vet
run: go vet ./...
- name: Build
run: go build -v ./...
run: |
tags="$(grep -I -r '// +build' . | \
grep -v '^./vendor/' | \
grep -v '^./hack/' | \
grep -v '^./third_party' | \
cut -f3 -d' ' | \
sort | uniq | \
grep -v '^!' | \
tr '\n' ' ')"
echo "Building with tags: ${tags}"
go test -vet=off -tags "${tags}" -run=^$ ./... | grep -v "no test" || true

View File

@ -72,3 +72,40 @@ jobs:
with:
version: v1.30
only-new-issues: true # for initial defensiveness
# This is mostly copied from https://github.com/get-woke/woke-action-reviewdog/blob/main/entrypoint.sh
# since their action is not yet released under a stable version.
- name: Language
shell: bash
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
WOKE_VERSION: v0.1.11
run: |
set -e
cd "${GITHUB_WORKSPACE}" || exit 1
TEMP_PATH="$(mktemp -d)"
PATH="${TEMP_PATH}:$PATH"
echo '::group::🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog'
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b "${TEMP_PATH}" 2>&1
echo '::endgroup::'
echo '::group:: Installing woke ... https://github.com/get-woke/woke'
curl -sfL https://raw.githubusercontent.com/get-woke/woke/main/install.sh | sh -s -- -b "${TEMP_PATH}" "${WOKE_VERSION}" 2>&1
echo '::endgroup::'
# Create a minimal .wokeignore if none already exist.
if [ ! -f .wokeignore ]; then
echo "vendor\nthird_party" > .wokeignore
fi
echo '::group:: Running woke with reviewdog 🐶 ...'
woke --output simple \
| reviewdog -efm="%f:%l:%c: %m" \
-name="woke" \
-reporter="github-pr-check" \
-filter-mode="added" \
-fail-on-error="true" \
-level="error" \
echo '::endgroup::'