From 39067bbe8770e0dbf849607996bf0094e0661dbe Mon Sep 17 00:00:00 2001 From: Sjur Millidahl Date: Mon, 18 Nov 2024 12:46:23 +0100 Subject: [PATCH] chore: remove github actions --- .github/ISSUE_TEMPLATE/bug_report.md | 40 ---- .github/ISSUE_TEMPLATE/feature_request.md | 24 --- .github/PULL_REQUEST_TEMPLATE.md | 36 ---- .github/workflows/backport.yml | 28 --- .github/workflows/ci.yml | 250 ---------------------- .github/workflows/codeql.yml | 42 ---- .github/workflows/commands.yml | 86 -------- .github/workflows/promote.yml | 48 ----- .github/workflows/tag.yml | 26 --- 9 files changed, 580 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/backport.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/codeql.yml delete mode 100644 .github/workflows/commands.yml delete mode 100644 .github/workflows/promote.yml delete mode 100644 .github/workflows/tag.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index a7b73b8b..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: Bug Report -about: Help us diagnose and fix bugs in Crossplane -labels: bug ---- - - -### What happened? - - - -### How can we reproduce it? - - -### What environment did it happen in? -Crossplane version: - - diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index c385d797..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: Feature Request -about: Help us make Crossplane more useful -labels: enhancement ---- - - -### What problem are you facing? - - -### How could Crossplane help solve your problem? - diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 46211600..00000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,36 +0,0 @@ - - -### Description of your changes - - -Fixes # - -I have: - -- [ ] Read and followed Crossplane's [contribution process]. -- [ ] Run `make reviewable` to ensure this PR is ready for review. -- [ ] Added `backport release-x.y` labels to auto-backport this PR if necessary. - -### How has this code been tested - - - -[contribution process]: https://git.io/fj2m9 diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml deleted file mode 100644 index 1ee4208e..00000000 --- a/.github/workflows/backport.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Backport - -on: - # NOTE(negz): This is a risky target, but we run this action only when and if - # a PR is closed, then filter down to specifically merged PRs. We also don't - # invoke any scripts, etc from within the repo. I believe the fact that we'll - # be able to review PRs before this runs makes this fairly safe. - # https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ - pull_request_target: - types: [closed] - # See also commands.yml for the /backport triggered variant of this workflow. - -jobs: - # NOTE(negz): I tested many backport GitHub actions before landing on this - # one. Many do not support merge commits, or do not support pull requests with - # more than one commit. This one does. It also handily links backport PRs with - # new PRs, and provides commentary and instructions when it can't backport. - # The main gotcha with this action is that PRs _must_ be labelled before they're - # merged to trigger a backport. - open-pr: - runs-on: ubuntu-22.04 - if: github.event.pull_request.merged - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Open Backport PR - uses: korthout/backport-action@v1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 0d3cd0ae..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,250 +0,0 @@ -name: CI - -on: - push: - branches: - - main - - release-* - pull_request: {} - workflow_dispatch: {} - -env: - # Common versions - GO_VERSION: '1.21' - GOLANGCI_VERSION: 'v1.54.0' - DOCKER_BUILDX_VERSION: 'v0.9.1' - - # Common users. We can't run a step 'if secrets.XXX != ""' but we can run a - # step 'if env.XXX' != ""', so we copy these to succinctly test whether - # credentials have been provided before trying to run steps that need them. - UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }} -jobs: - detect-noop: - runs-on: ubuntu-22.04 - outputs: - noop: ${{ steps.noop.outputs.should_skip }} - steps: - - name: Detect No-op Changes - id: noop - uses: fkirc/skip-duplicate-actions@v5.2.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - paths_ignore: '["**.md", "**.png", "**.jpg"]' - do_not_skip: '["workflow_dispatch", "schedule", "push"]' - - - lint: - runs-on: ubuntu-22.04 - needs: detect-noop - if: needs.detect-noop.outputs.noop != 'true' - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GO_VERSION }} - - - name: Find the Go Build Cache - id: go - run: echo "cachedir=$(make go.cachedir)" >> $GITHUB_ENV - - - name: Cache the Go Build Cache - uses: actions/cache@v3 - with: - path: ${{ env.cachedir }} - key: ${{ runner.os }}-build-lint-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-build-lint- - - - name: Cache Go Dependencies - uses: actions/cache@v3 - with: - path: .work/pkg - key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-pkg- - - - name: Download Go Modules - run: make modules.download modules.check - - # We could run 'make lint' but we prefer this action because it leaves - # 'annotations' (i.e. it comments on PRs to point out linter violations). - - name: Lint - uses: golangci/golangci-lint-action@v3 - with: - version: ${{ env.GOLANGCI_VERSION }} - - check-diff: - runs-on: ubuntu-22.04 - needs: detect-noop - if: needs.detect-noop.outputs.noop != 'true' - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GO_VERSION }} - - - name: Find the Go Build Cache - id: go - run: echo "cachedir=$(make go.cachedir)" >> $GITHUB_ENV - - - name: Cache the Go Build Cache - uses: actions/cache@v3 - with: - path: ${{ env.cachedir }} - key: ${{ runner.os }}-build-check-diff-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-build-check-diff- - - - name: Cache Go Dependencies - uses: actions/cache@v3 - with: - path: .work/pkg - key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-pkg- - - - name: Download Go Modules - run: make modules.download modules.check - - - name: Check Diff - id: check-diff - run: | - mkdir _output - make check-diff - - - name: Show diff - if: failure() && steps.check-diff.outcome == 'failure' - run: git diff - - unit-tests: - runs-on: ubuntu-22.04 - needs: detect-noop - if: needs.detect-noop.outputs.noop != 'true' - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - - name: Fetch History - run: git fetch --prune --unshallow - - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GO_VERSION }} - - - name: Find the Go Build Cache - id: go - run: echo "cachedir=$(make go.cachedir)" >> $GITHUB_ENV - - - name: Cache the Go Build Cache - uses: actions/cache@v3 - with: - path: ${{ env.cachedir }} - key: ${{ runner.os }}-build-unit-tests-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-build-unit-tests- - - - name: Cache Go Dependencies - uses: actions/cache@v3 - with: - path: .work/pkg - key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-pkg- - - - name: Download Go Modules - run: make modules.download modules.check - - - name: Run Unit Tests - run: make -j2 test - - - name: Publish Unit Test Coverage - uses: codecov/codecov-action@v3 - with: - flags: unittests - file: _output/tests/linux_amd64/coverage.txt - - publish-artifacts: - runs-on: ubuntu-22.04 - needs: detect-noop - if: needs.detect-noop.outputs.noop != 'true' - - steps: - - name: Setup QEMU - uses: docker/setup-qemu-action@v2 - with: - platforms: all - - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v2 - with: - version: ${{ env.DOCKER_BUILDX_VERSION }} - install: true - - - name: Login to Upbound - uses: docker/login-action@v1 - if: env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != '' - with: - registry: xpkg.upbound.io - username: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }} - password: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }} - - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - - name: Fetch History - run: git fetch --prune --unshallow - - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GO_VERSION }} - - - name: Find the Go Build Cache - id: go - run: echo "cachedir=$(make go.cachedir)" >> $GITHUB_ENV - - - name: Cache the Go Build Cache - uses: actions/cache@v3 - with: - path: ${{ env.cachedir }} - key: ${{ runner.os }}-build-publish-artifacts-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-build-publish-artifacts- - - - name: Cache Go Dependencies - uses: actions/cache@v3 - with: - path: .work/pkg - key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-pkg- - - - name: Download Go Modules - run: make modules.download modules.check - - - name: Build Artifacts - run: make -j2 build.all - env: - # We're using docker buildx, which doesn't actually load the images it - # builds by default. Specifying --load does so. - BUILD_ARGS: "--load" - - - name: Publish Artifacts to GitHub - uses: actions/upload-artifact@v3 - with: - name: output - path: _output/** - - - name: Publish Artifacts - if: env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != '' - run: make publish BRANCH_NAME=${GITHUB_REF##*/} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index fee244fe..00000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: CodeQL - -on: - push: - branches: - - main - - release-* - workflow_dispatch: {} - -jobs: - detect-noop: - runs-on: ubuntu-22.04 - outputs: - noop: ${{ steps.noop.outputs.should_skip }} - steps: - - name: Detect No-op Changes - id: noop - uses: fkirc/skip-duplicate-actions@v5.2.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - paths_ignore: '["**.md", "**.png", "**.jpg"]' - do_not_skip: '["workflow_dispatch", "schedule", "push"]' - concurrent_skipping: false - - analyze: - runs-on: ubuntu-22.04 - needs: detect-noop - if: needs.detect-noop.outputs.noop != 'true' - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: go - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/commands.yml b/.github/workflows/commands.yml deleted file mode 100644 index df101a8e..00000000 --- a/.github/workflows/commands.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Comment Commands - -on: issue_comment - -jobs: - points: - runs-on: ubuntu-22.04 - if: startsWith(github.event.comment.body, '/points') - - steps: - - name: Extract Command - id: command - uses: xt0rted/slash-command-action@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - command: points - reaction: "true" - reaction-type: "eyes" - allow-edits: "false" - permission-level: write - - name: Handle Command - uses: actions/github-script@v4 - env: - POINTS: ${{ steps.command.outputs.command-arguments }} - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const points = process.env.POINTS - - if (isNaN(parseInt(points))) { - console.log("Malformed command - expected '/points '") - github.reactions.createForIssueComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: context.payload.comment.id, - content: "confused" - }) - return - } - const label = "points/" + points - - // Delete our needs-points-label label. - try { - await github.issues.deleteLabel({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - name: ['needs-points-label'] - }) - console.log("Deleted 'needs-points-label' label.") - } - catch(e) { - console.log("Label 'needs-points-label' probably didn't exist.") - } - - // Add our points label. - github.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: [label] - }) - console.log("Added '" + label + "' label.") - - # NOTE(negz): See also backport.yml, which is the variant that triggers on PR - # merge rather than on comment. - backport: - runs-on: ubuntu-22.04 - if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/backport') - steps: - - name: Extract Command - id: command - uses: xt0rted/slash-command-action@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - command: backport - reaction: "true" - reaction-type: "eyes" - allow-edits: "false" - permission-level: write - - - name: Checkout - uses: actions/checkout@v3 - - - name: Open Backport PR - uses: korthout/backport-action@v1 diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml deleted file mode 100644 index a63c4aea..00000000 --- a/.github/workflows/promote.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Promote - -on: - workflow_dispatch: - inputs: - version: - description: 'Release version (e.g. v0.1.0)' - required: true - channel: - description: 'Release channel' - required: true - default: 'stable' - -env: - # Common users. We can't run a step 'if secrets.AWS_USR != ""' but we can run - # a step 'if env.AWS_USR' != ""', so we copy these to succinctly test whether - # credentials have been provided before trying to run steps that need them. - DOCKER_USR: ${{ secrets.DOCKER_USR }} - AWS_USR: ${{ secrets.AWS_USR }} - -jobs: - promote-artifacts: - runs-on: ubuntu-22.04 - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - - name: Fetch History - run: git fetch --prune --unshallow - - - name: Login to Docker - uses: docker/login-action@v1 - if: env.DOCKER_USR != '' - with: - username: ${{ secrets.DOCKER_USR }} - password: ${{ secrets.DOCKER_PSW }} - - - name: Promote Artifacts in S3 and Docker Hub - if: env.AWS_USR != '' && env.DOCKER_USR != '' - run: make -j2 promote BRANCH_NAME=${GITHUB_REF##*/} - env: - VERSION: ${{ github.event.inputs.version }} - CHANNEL: ${{ github.event.inputs.channel }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_USR }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PSW }} diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml deleted file mode 100644 index db32dd0f..00000000 --- a/.github/workflows/tag.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Tag - -on: - workflow_dispatch: - inputs: - version: - description: 'Release version (e.g. v0.1.0)' - required: true - message: - description: 'Tag message' - required: true - -jobs: - create-tag: - runs-on: ubuntu-22.04 - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Create Tag - uses: negz/create-tag@v1 - with: - version: ${{ github.event.inputs.version }} - message: ${{ github.event.inputs.message }} - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file