From 4cdd086967d44da4546642e5d81799c22e3dea0c Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Thu, 13 May 2021 21:45:05 -0400 Subject: [PATCH] Break free from Knative actions (#1016) --- ...tive-boilerplate.yaml => boilerplate.yaml} | 34 +--- .github/workflows/build.yaml | 21 +++ ...tive-donotsubmit.yaml => donotsubmit.yaml} | 23 +-- .github/workflows/knative-go-build.yaml | 59 ------- .github/workflows/knative-go-test.yaml | 65 -------- .github/workflows/knative-releasability.yaml | 157 ------------------ .github/workflows/knative-release-notes.yaml | 96 ----------- .github/workflows/knative-security.yaml | 50 ------ .github/workflows/knative-stale.yaml | 49 ------ .github/workflows/release.yml | 20 +-- .github/workflows/stale.yaml | 30 ++++ .../{knative-style.yaml => style.yaml} | 27 +-- .github/workflows/test.yaml | 23 +++ .../{knative-verify.yaml => verify.yaml} | 49 ++---- 14 files changed, 101 insertions(+), 602 deletions(-) rename .github/workflows/{knative-boilerplate.yaml => boilerplate.yaml} (62%) create mode 100644 .github/workflows/build.yaml rename .github/workflows/{knative-donotsubmit.yaml => donotsubmit.yaml} (58%) delete mode 100644 .github/workflows/knative-go-build.yaml delete mode 100644 .github/workflows/knative-go-test.yaml delete mode 100644 .github/workflows/knative-releasability.yaml delete mode 100644 .github/workflows/knative-release-notes.yaml delete mode 100644 .github/workflows/knative-security.yaml delete mode 100644 .github/workflows/knative-stale.yaml create mode 100644 .github/workflows/stale.yaml rename .github/workflows/{knative-style.yaml => style.yaml} (89%) create mode 100644 .github/workflows/test.yaml rename .github/workflows/{knative-verify.yaml => verify.yaml} (51%) diff --git a/.github/workflows/knative-boilerplate.yaml b/.github/workflows/boilerplate.yaml similarity index 62% rename from .github/workflows/knative-boilerplate.yaml rename to .github/workflows/boilerplate.yaml index c0e648b1c..38c77b2d1 100644 --- a/.github/workflows/knative-boilerplate.yaml +++ b/.github/workflows/boilerplate.yaml @@ -1,25 +1,8 @@ -# 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/knative-sandbox/knobots and will be overwritten. - name: Boilerplate on: pull_request: - branches: [ 'main', 'master', 'release-*' ] + branches: ['main'] jobs: @@ -41,15 +24,11 @@ jobs: language: Bash steps: - - - name: Set up Go 1.15.x - uses: actions/setup-go@v2 + - uses: actions/setup-go@v2 with: - go-version: 1.15.x - id: go + go-version: 1.16.x - - name: Check out code - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - name: Install Tools run: | @@ -66,13 +45,8 @@ jobs: 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: | diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..0c2b8d9b3 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,21 @@ +name: Build + +on: + pull_request: + branches: ['main'] + +jobs: + + build: + name: Build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.16.x + + - run: | + go build ./... + go test -run=^$ ./... diff --git a/.github/workflows/knative-donotsubmit.yaml b/.github/workflows/donotsubmit.yaml similarity index 58% rename from .github/workflows/knative-donotsubmit.yaml rename to .github/workflows/donotsubmit.yaml index cec5c3077..a48c1b338 100644 --- a/.github/workflows/knative-donotsubmit.yaml +++ b/.github/workflows/donotsubmit.yaml @@ -1,25 +1,8 @@ -# 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/knative-sandbox/knobots and will be overwritten. - name: Do Not Submit on: pull_request: - branches: [ 'main', 'master', 'release-*' ] + branches: ['main'] jobs: @@ -28,9 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - name: Check out code - uses: actions/checkout@v2 - + - uses: actions/checkout@v2 - name: Do Not Submit shell: bash env: diff --git a/.github/workflows/knative-go-build.yaml b/.github/workflows/knative-go-build.yaml deleted file mode 100644 index 7bd13004a..000000000 --- a/.github/workflows/knative-go-build.yaml +++ /dev/null @@ -1,59 +0,0 @@ -# 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/knative-sandbox/knobots and will be overwritten. - -name: Build - -on: - pull_request: - branches: [ 'main', '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 - diff --git a/.github/workflows/knative-go-test.yaml b/.github/workflows/knative-go-test.yaml deleted file mode 100644 index 965df1e74..000000000 --- a/.github/workflows/knative-go-test.yaml +++ /dev/null @@ -1,65 +0,0 @@ -# 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/knative-sandbox/knobots and will be overwritten. - -name: Test - -on: - - push: - branches: [ 'main', 'master' ] - - pull_request: - branches: [ 'main', '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 ./... - - - if: steps.codecov-enabled.outputs.files_exists == 'true' - name: Codecov - uses: codecov/codecov-action@v1 diff --git a/.github/workflows/knative-releasability.yaml b/.github/workflows/knative-releasability.yaml deleted file mode 100644 index c4f5fb732..000000000 --- a/.github/workflows/knative-releasability.yaml +++ /dev/null @@ -1,157 +0,0 @@ -# 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: 'Releasability' - -on: - schedule: - - cron: '0 1 * * 1-5' # 6am Pacific, weekdays. - - workflow_dispatch: # Manual trigger. - inputs: - releaseFamily: - description: 'Release? (vX.Y)' - slackChannel: - description: 'Slack Channel? (release-#)' - -jobs: - releasability: - name: Releasability - runs-on: 'ubuntu-latest' - - env: - ######################################### - # Update this section each release. # - RELEASE: 'v0.23' - SLACK_CHANNEL: 'release-23' - ######################################### - - steps: - - name: Defaults - run: | - # If manual trigger sent releaseFamily and slackChannel, then override them - if [[ "${{ github.event.inputs.releaseFamily }}" != "" ]]; then - echo "RELEASE=${{ github.event.inputs.releaseFamily }}" >> $GITHUB_ENV - fi - if [[ "${{ github.event.inputs.slackChannel }}" != "" ]]; then - echo "SLACK_CHANNEL=${{ github.event.inputs.slackChannel }}" >> $GITHUB_ENV - fi - if [[ "${{ secrets.SLACK_WEBHOOK }}" != "" ]]; then - echo "SLACK_WEBHOOK=exists" >> $GITHUB_ENV - fi - - - name: Set up Go 1.15.x - uses: actions/setup-go@v2 - with: - go-version: 1.15.x - - - name: Install Dependencies - run: GO111MODULE=on go get knative.dev/test-infra/buoy@main - - - name: Check out code - uses: actions/checkout@v2 - - - name: Exists - id: exists - run: | - EXISTS=0 - buoy exists go.mod --release ${RELEASE} --verbose || EXISTS=$? - if [[ "$EXISTS" -eq "0" ]]; then - EXISTS=true - else - EXISTS=false - fi - echo ::set-output name=release-branch::${EXISTS} - - - name: Check - if: steps.exists.outputs.release-branch == 'false' - run: | - # The following pushes the stdout of buoy into $CHECK_MESSAGE - CHECK=0 - echo 'CHECK_MESSAGE<> $GITHUB_ENV - buoy check go.mod --release ${RELEASE} --domain knative.dev --verbose >> $GITHUB_ENV 2>&1 || CHECK=$? - echo 'EOF' >> $GITHUB_ENV - - # We just captured the return code of the buoy call, test it to see - # if we should continue validating. The next steps short circuit if - # we already know we are not ready for a release. - if [[ "$CHECK" -eq "0" ]]; then - echo 'current=true' >> $GITHUB_ENV - else - echo 'current=false' >> $GITHUB_ENV - fi - - - name: Upgrade - if: steps.exists.outputs.release-branch == 'false' && env.current == 'true' - run: | - # if update deps returns un-successful, then mark current to false. - if ! ./hack/update-deps.sh --release ${RELEASE} --upgrade; then - echo "VERIFY_MESSAGE=Unable to update deps for ${{ github.repository }}." >> $GITHUB_ENV - echo 'current=false' >> $GITHUB_ENV - fi - - - name: Verify - if: steps.exists.outputs.release-branch == 'false' && env.current == 'true' - run: | - # If we don't run `git status` before the "git diff-index" it seems - # to list every file that's been touched by codegen. - git status - - CHANGED="$(git diff-index --name-only HEAD --)" - - # If we see no changes after the upgrade, then we are up to date. - if [[ "$CHANGED" == "" ]]; then - echo "VERIFY_MESSAGE=${{ github.repository }} up to date." >> $GITHUB_ENV - else - echo "VERIFY_MESSAGE=${{ github.repository }} is out of date." >> $GITHUB_ENV - echo "The following files are changed: $CHANGED" - echo 'current=false' >> $GITHUB_ENV - fi - - - name: Status GO - if: steps.exists.outputs.release-branch == 'false' && env.current == 'true' - run: | - echo 'SLACK_COLOR=#098e00' >> $GITHUB_ENV - echo 'SLACK_TITLE=Releasability for ${{ github.repository }} @ ${{ env.RELEASE }} is GO!' >> $GITHUB_ENV - - - name: Status NO-GO - if: steps.exists.outputs.release-branch == 'false' && env.current == 'false' - run: | - echo 'SLACK_COLOR=#8E1600' >> $GITHUB_ENV - echo 'SLACK_TITLE=Releasability for ${{ github.repository }} @ ${{ env.RELEASE }} is NO-GO!' >> $GITHUB_ENV - - - name: Post status to Slack - # Note: using env.SLACK_WEBHOOK here because secrets are not allowed in the if block. - if: env.SLACK_WEBHOOK != '' && steps.exists.outputs.release-branch == 'false' - uses: rtCamp/action-slack-notify@v2.1.0 - env: - SLACK_ICON: http://github.com/knative.png?size=48 - SLACK_USERNAME: github-actions - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - MSG_MINIMAL: 'true' - SLACK_MESSAGE: | - ${{ env.CHECK_MESSAGE }} - ${{ env.VERIFY_MESSAGE }} - For detailed logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - - - name: Fail if NO-GO - if: steps.exists.outputs.release-branch == 'false' && env.current == 'false' - run: | - # When we have figured out that things are NO-GO, we intentionally fail the job - # so that the status badge shows up red and we can use the badges to create a - # releasability dashboard for all of the repos. - exit 1 diff --git a/.github/workflows/knative-release-notes.yaml b/.github/workflows/knative-release-notes.yaml deleted file mode 100644 index 172eb390c..000000000 --- a/.github/workflows/knative-release-notes.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# 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/knative-sandbox/knobots and will be overwritten. - -name: 'Release Notes' - -on: - workflow_dispatch: - inputs: - branch: - description: 'Branch? (main)' - required: true - default: 'main' - start-sha: - description: 'Starting SHA? (last tag on branch)' - end-sha: - description: 'Ending SHA? (latest HEAD)' - -jobs: - release-notes: - name: Release Notes - runs-on: 'ubuntu-latest' - - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - steps: - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.16.x - - - name: Install Dependencies - run: GO111MODULE=on go get k8s.io/release/cmd/release-notes - - - name: Check out code - uses: actions/checkout@v2 - with: - # fetch-depth of 0 indicates all history for all branches and tags. - fetch-depth: 0 - - # Note: Defaults needs to run after we check out the repo. - - name: Defaults - run: | - echo ORG=$(echo '${{ github.repository }}' | awk -F '/' '{print $1}') >> $GITHUB_ENV - echo REPO=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}') >> $GITHUB_ENV - - echo "BRANCH=${{ github.event.inputs.branch }}" >> $GITHUB_ENV - - if [[ "${{ github.event.inputs.start-sha }}" != "" ]]; then - echo "START_SHA=${{ github.event.inputs.start-sha }}" >> $GITHUB_ENV - else - # Default Starting SHA (thanks @dprotaso) - export semver=$(git describe --match "v[0-9]*" --abbrev=0) - echo "Using ${semver} tag for starting sha." - echo START_SHA=$(git rev-list -n 1 "${semver}") >> $GITHUB_ENV - fi - - if [[ "${{ github.event.inputs.end-sha }}" != "" ]]; then - echo "END_SHA=${{ github.event.inputs.end-sha }}" >> $GITHUB_ENV - else - # Default Ending SHA (thanks @dprotaso) - echo "END_SHA=$(git rev-list -n 1 HEAD)" >> $GITHUB_ENV - fi - - - name: Generate Notes - run: | - # See https://github.com/kubernetes/release/tree/master/cmd/release-notes for options. - # Note: we are setting env vars in the Defaults step. - release-notes \ - --required-author "" \ - --repo-path "$(pwd)" \ - --output release-notes.md - - - name: Display Notes - run: | - cat release-notes.md - - - name: Archive Release Notes - uses: actions/upload-artifact@v2 - with: - name: release-notes.md - path: release-notes.md diff --git a/.github/workflows/knative-security.yaml b/.github/workflows/knative-security.yaml deleted file mode 100644 index fbfe531d9..000000000 --- a/.github/workflows/knative-security.yaml +++ /dev/null @@ -1,50 +0,0 @@ -# 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/knative-sandbox/knobots and will be overwritten. - -name: 'Security' - -on: - push: - branches: [ 'main', 'master', 'release-*' ] - - pull_request: - branches: [ 'main', '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 - - # 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 diff --git a/.github/workflows/knative-stale.yaml b/.github/workflows/knative-stale.yaml deleted file mode 100644 index 972826971..000000000 --- a/.github/workflows/knative-stale.yaml +++ /dev/null @@ -1,49 +0,0 @@ -# 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/knative-sandbox/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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56c23b6f8..b4f104a5f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,27 +2,19 @@ name: goreleaser on: push: - tags: - - '*' + tags: ['*'] jobs: goreleaser: runs-on: ubuntu-latest steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Unshallow + - uses: actions/checkout@v2 + - name: Unshallow run: git fetch --prune --unshallow - - - name: Set up Go - uses: actions/setup-go@v1 + - uses: actions/setup-go@v1 with: - go-version: 1.14 - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + go-version: 1.16.x + - uses: goreleaser/goreleaser-action@v2 with: version: latest args: release --rm-dist diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml new file mode 100644 index 000000000..12d7444c1 --- /dev/null +++ b/.github/workflows/stale.yaml @@ -0,0 +1,30 @@ +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 }} + + 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. Keep frash with the 'lifecycle/frozen' label. + 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. Keep fresh with the 'lifecycle/frozen' label. + stale-pr-label: 'lifecycle/stale' + exempt-pr-labels: 'lifecycle/frozen' + + days-before-stale: 90 + days-before-close: 30 diff --git a/.github/workflows/knative-style.yaml b/.github/workflows/style.yaml similarity index 89% rename from .github/workflows/knative-style.yaml rename to .github/workflows/style.yaml index c5770a4b0..dda7e58fc 100644 --- a/.github/workflows/knative-style.yaml +++ b/.github/workflows/style.yaml @@ -1,25 +1,8 @@ -# 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/knative-sandbox/knobots and will be overwritten. - name: Code Style on: pull_request: - branches: [ 'main', 'master', 'release-*' ] + branches: ['main'] jobs: @@ -40,10 +23,10 @@ jobs: importpath: golang.org/x/tools/cmd/goimports steps: - - name: Set up Go 1.15.x + - name: Set up Go 1.16.x uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.16.x id: go - name: Check out code @@ -89,10 +72,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.15.x + - name: Set up Go 1.16.x uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.16.x id: go - name: Check out code diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 000000000..1fa408b42 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,23 @@ +name: Test + +on: + push: + branches: ['main'] + pull_request: + branches: ['main'] + +jobs: + + test: + name: Unit Tests + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.16.x + + - run: go test -coverprofile=coverage.txt -covermode=atomic -race ./... + + - uses: codecov/codecov-action@v1 diff --git a/.github/workflows/knative-verify.yaml b/.github/workflows/verify.yaml similarity index 51% rename from .github/workflows/knative-verify.yaml rename to .github/workflows/verify.yaml index 5f20c548b..b696f4903 100644 --- a/.github/workflows/knative-verify.yaml +++ b/.github/workflows/verify.yaml @@ -1,64 +1,35 @@ -# 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/knative-sandbox/knobots and will be overwritten. - name: Verify on: pull_request: - branches: [ 'main', 'master', 'release-*' ] + branches: ['main'] jobs: verify: name: Verify Deps and Codegen - strategy: - matrix: - go-version: [1.15.x] - platform: [ubuntu-latest] - - runs-on: ${{ matrix.platform }} + runs-on: ubuntu-latest env: GOPATH: ${{ github.workspace }} steps: - - - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v2 + - uses: actions/setup-go@v2 with: - go-version: ${{ matrix.go-version }} - id: go + go-version: 1.16.x + - name: Check out code onto GOPATH + uses: actions/checkout@v2 + with: + path: ./src/${{ github.event.repository.name }} - name: Install Dependencies run: | - curl -L https://github.com/google/ko/releases/download/v0.6.0/ko_0.6.0_Linux_x86_64.tar.gz | tar xzf - ko - chmod +x ./ko - sudo mv ko /usr/local/bin go get github.com/google/go-licenses - - name: Check out code onto GOPATH - uses: actions/checkout@v2 - with: - path: ./src/knative.dev/${{ github.event.repository.name }} - - name: Update Codegen shell: bash run: | - pushd ./src/knative.dev/${{ github.event.repository.name }} + pushd ./src/${{ github.event.repository.name }} [[ ! -f hack/update-codegen.sh ]] || ./hack/update-codegen.sh popd @@ -72,7 +43,7 @@ jobs: sed ':begin;$!N;s/\n/%0A/;tbegin' } - pushd ./src/knative.dev/${{ github.event.repository.name }} + pushd ./src/${{ github.event.repository.name }} if [[ -z "$(git status --porcelain)" ]]; then echo "${{ github.repository }} up to date." else