-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Automated] Update actions #1061
Merged
knative-prow-robot
merged 1 commit into
knative:master
from
mattmoor:auto-updates/common-actions
Oct 14, 2020
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# Copyright 2020 The Knative Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This file is automagically synced here from github.com/knative-sandbox/.github | ||
# repo by knobots: https://github.com/mattmoor/knobots and will be overwritten. | ||
|
||
name: Boilerplate | ||
|
||
on: | ||
pull_request: | ||
branches: [ 'master', 'release-*' ] | ||
|
||
jobs: | ||
|
||
check: | ||
name: Boilerplate Check | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false # Keep running if one leg fails. | ||
matrix: | ||
extension: | ||
- go | ||
- sh | ||
|
||
# Map between extension and human-readable name. | ||
include: | ||
- extension: go | ||
language: Go | ||
- extension: sh | ||
language: Bash | ||
|
||
steps: | ||
|
||
- name: Set up Go 1.15.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15.x | ||
id: go | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Tools | ||
run: | | ||
TEMP_PATH="$(mktemp -d)" | ||
cd $TEMP_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 boilerplate-check ... https://github.com/mattmoor/boilerplate-check' | ||
go get github.com/mattmoor/boilerplate-check/cmd/boilerplate-check | ||
echo '::endgroup::' | ||
|
||
echo "${TEMP_PATH}" >> $GITHUB_PATH | ||
|
||
- id: boilerplate_txt | ||
uses: andstor/file-existence-action@v1 | ||
with: | ||
files: ./hack/boilerplate/boilerplate.${{ matrix.extension }}.txt | ||
- name: ${{ matrix.language }} license boilerplate | ||
shell: bash | ||
if: ${{ steps.boilerplate_txt.outputs.files_exists == 'true' }} | ||
env: | ||
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} | ||
run: | | ||
set -e | ||
cd "${GITHUB_WORKSPACE}" || exit 1 | ||
|
||
echo '::group:: Running github.com/mattmoor/boilerplate-check for ${{ matrix.language }} with reviewdog 🐶 ...' | ||
# Don't fail because of boilerplate-check | ||
set +o pipefail | ||
boilerplate-check check \ | ||
--boilerplate ./hack/boilerplate/boilerplate.${{ matrix.extension }}.txt \ | ||
--file-extension ${{ matrix.extension }} \ | ||
--exclude "(vendor|third_party)/" | | ||
reviewdog -efm="%A%f:%l: %m" \ | ||
-efm="%C%.%#" \ | ||
-name="${{ matrix.language }} headers" \ | ||
-reporter="github-pr-check" \ | ||
-filter-mode="diff_context" \ | ||
-fail-on-error="true" \ | ||
-level="error" | ||
echo '::endgroup::' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Copyright 2020 The Knative Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This file is automagically synced here from github.com/knative-sandbox/.github | ||
# repo by knobots: https://github.com/mattmoor/knobots and will be overwritten. | ||
|
||
name: Do Not Submit | ||
|
||
on: | ||
pull_request: | ||
branches: [ 'master', 'release-*' ] | ||
|
||
jobs: | ||
|
||
donotsubmit: | ||
name: Do Not Submit | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Do Not Submit | ||
shell: bash | ||
env: | ||
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} | ||
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:: Running DO NOT SUBMIT with reviewdog 🐶 ...' | ||
# Don't fail because of grep | ||
set +o pipefail | ||
find . -type f -not -path './vendor/*' -not -path './third_party/*' -not -path './.git/*' -not -path './.github/workflows/*' | | ||
xargs grep -n "DO NOT SUBMIT" | | ||
reviewdog -efm="%f:%l:%m" \ | ||
-name="DO NOT SUBMIT" \ | ||
-reporter="github-pr-check" \ | ||
-filter-mode="added" \ | ||
-fail-on-error="true" \ | ||
-level="error" | ||
|
||
echo '::endgroup::' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Copyright 2020 The Knative Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This file is automagically synced here from github.com/knative-sandbox/.github | ||
# repo by knobots: https://github.com/mattmoor/knobots and will be overwritten. | ||
|
||
name: Build | ||
|
||
on: | ||
pull_request: | ||
branches: [ 'master', 'release-*' ] | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build | ||
strategy: | ||
matrix: | ||
go-version: [1.15.x] | ||
platform: [ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
|
||
- name: Set up Go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
id: go | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Copyright 2020 The Knative Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This file is automagically synced here from github.com/knative-sandbox/.github | ||
# repo by knobots: https://github.com/mattmoor/knobots and will be overwritten. | ||
|
||
name: Test | ||
|
||
on: | ||
|
||
push: | ||
branches: [ 'master' ] | ||
|
||
pull_request: | ||
branches: [ 'master', 'release-*' ] | ||
|
||
jobs: | ||
|
||
test: | ||
name: Unit Tests | ||
strategy: | ||
matrix: | ||
go-version: [1.15.x] | ||
platform: [ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
|
||
- name: Set up Go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
id: go | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Check for .codecov.yaml | ||
id: codecov-enabled | ||
uses: andstor/file-existence-action@v1 | ||
with: | ||
files: .codecov.yaml | ||
|
||
- if: steps.codecov-enabled.outputs.files_exists == 'true' | ||
name: Produce Go Coverage | ||
run: echo 'COVER_OPTS=-coverprofile=coverage.txt -covermode=atomic' >> $GITHUB_ENV | ||
|
||
- name: Test | ||
run: go test -race $COVER_OPTS ./... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how is this substantially different from the 'build' step above, except that it also check the code coverage ? Maybe both actions could be combined to reduce the overhead ? (and save some trees) |
||
|
||
- if: steps.codecov-enabled.outputs.files_exists == 'true' | ||
name: Codecov | ||
uses: codecov/codecov-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Copyright 2020 The Knative Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This file is automagically synced here from github.com/knative-sandbox/.github | ||
# repo by knobots: https://github.com/mattmoor/knobots and will be overwritten. | ||
|
||
name: 'Security' | ||
|
||
on: | ||
pull_request: | ||
branches: [ 'master', 'release-*' ] | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
# We must fetch at least the immediate parents so that if this is | ||
# a pull request then we can checkout the head. | ||
fetch-depth: 2 | ||
|
||
# If this run was triggered by a pull request event, then checkout | ||
# the head of the pull request instead of the merge commit. | ||
- run: git checkout HEAD^2 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: go | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v1 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Copyright 2020 The Knative Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This file is automagically synced here from github.com/knative-sandbox/.github | ||
# repo by knobots: https://github.com/mattmoor/knobots and will be overwritten. | ||
|
||
name: 'Close stale' | ||
|
||
on: | ||
schedule: | ||
- cron: '0 1 * * *' | ||
|
||
jobs: | ||
stale: | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- uses: 'actions/stale@v3' | ||
with: | ||
repo-token: '${{ secrets.GITHUB_TOKEN }}' # No need to setup | ||
|
||
stale-issue-message: |- | ||
This issue is stale because it has been open for 90 days with no | ||
activity. It will automatically close after 30 more days of | ||
inactivity. Reopen the issue with `/reopen`. Mark the issue as | ||
fresh by adding the comment `/remove-lifecycle stale`. | ||
stale-issue-label: 'lifecycle/stale' | ||
exempt-issue-labels: 'lifecycle/frozen' | ||
|
||
stale-pr-message: |- | ||
This Pull Request is stale because it has been open for 90 days with | ||
no activity. It will automatically close after 30 more days of | ||
inactivity. Reopen with `/reopen`. Mark as fresh by adding the | ||
comment `/remove-lifecycle stale`. | ||
stale-pr-label: 'lifecycle/stale' | ||
exempt-pr-labels: 'lifecycle/frozen' | ||
|
||
days-before-stale: 90 | ||
days-before-close: 30 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like that this "Build" step also runs the tests. Maybe the name should reflect this or this command should be changed to
go build
On the other hand, I wonder why we shouldn't run our on
build.sh
which would also do all the testing ?