Skip to content

Commit

Permalink
chore(ci): update build/ and github workflows (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
Duologic authored Nov 7, 2024
1 parent b64544e commit 92afae6
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 110 deletions.
23 changes: 2 additions & 21 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,5 @@ on:
# 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 gotchas with this action are that it _only_ supports merge commits,
# and 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@v4
with:
fetch-depth: 0

- name: Open Backport PR
uses: zeebe-io/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_workspace: ${{ github.workspace }}
version: v0.0.8
backport:
uses: upbound/official-providers-ci/.github/workflows/provider-backport.yml@standard-runners
89 changes: 53 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ env:

jobs:
detect-noop:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
Expand All @@ -33,20 +33,46 @@ jobs:
paths_ignore: '["**.md", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'

report-breaking-changes:
runs-on: ubuntu-24.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
submodules: true

- name: Get modified CRDs
id: modified-crds
uses: tj-actions/changed-files@v45
with:
files: |
package/crds/**
- name: Report breaking CRD OpenAPI v3 schema changes
if: steps.modified-crds.outputs.any_changed == 'true'
env:
MODIFIED_CRD_LIST: ${{ steps.modified-crds.outputs.all_changed_files }}
run: |
make crddiff
- name: Report native schema version changes
if: ${{ inputs.upjet-based-provider }}
run: |
make schema-version-diff
lint:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
submodules: true

- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version: ${{ env.GO_VERSION }}

Expand Down Expand Up @@ -79,18 +105,18 @@ jobs:
version: ${{ env.GOLANGCI_VERSION }}

check-diff:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
submodules: true

- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version: ${{ env.GO_VERSION }}

Expand Down Expand Up @@ -122,21 +148,21 @@ jobs:
run: make check-diff

unit-tests:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
submodules: true

- name: Fetch History
run: git fetch --prune --unshallow

- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version: ${{ env.GO_VERSION }}

Expand Down Expand Up @@ -165,27 +191,27 @@ jobs:
run: make -j2 test

- name: Publish Unit Test Coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
with:
flags: unittests
file: _output/tests/linux_amd64/coverage.txt

local-deploy:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
submodules: true

- name: Fetch History
run: git fetch --prune --unshallow

- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version: ${{ env.GO_VERSION }}

Expand Down Expand Up @@ -214,13 +240,19 @@ jobs:
run: make local-deploy

publish-artifacts:
runs-on: ubuntu-22.04
needs: detect-noop
runs-on: ubuntu-24.04
needs:
- detect-noop
- report-breaking-changes
- lint
- check-diff
- unit-tests
- local-deploy
if: needs.detect-noop.outputs.noop != 'true'

steps:
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
with:
platforms: all

Expand All @@ -239,15 +271,15 @@ jobs:
password: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }}

- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
submodules: true

- name: Fetch History
run: git fetch --prune --unshallow

- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version: ${{ env.GO_VERSION }}

Expand Down Expand Up @@ -280,26 +312,11 @@ jobs:
BUILD_ARGS: "--load"

- name: Upload Artifacts to GitHub
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
with:
name: output
path: _output/**

- name: Publish Artifacts
if: env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != ''
run: make publish BRANCH_NAME=${GITHUB_REF##*/}
env:
UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }}
UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }}

e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: make e2e-oss
28 changes: 2 additions & 26 deletions .github/workflows/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,5 @@ name: Comment Commands
on: issue_comment

jobs:
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@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
command: backport
reaction: "true"
reaction-type: "eyes"
allow-edits: "false"
permission-level: write

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Open Backport PR
uses: zeebe-io/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_workspace: ${{ github.workspace }}
version: v0.0.4
comment-commands:
uses: upbound/official-providers-ci/.github/workflows/provider-commands.yml@standard-runners
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
e2e:
uses: upbound/uptest/.github/workflows/pr-comment-trigger.yml@main
uses: upbound/official-providers-ci/.github/workflows/pr-comment-trigger.yml@standard-runners
secrets:
UPTEST_CLOUD_CREDENTIALS: ${{ secrets.UPTEST_CLOUD_CREDENTIALS }}
UPTEST_DATASOURCE: ${{ secrets.UPTEST_DATASOURCE }}
18 changes: 5 additions & 13 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,8 @@ on:
required: true

jobs:
create-tag:
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create Tag
uses: negz/create-tag@v1
with:
version: ${{ github.event.inputs.version }}
message: ${{ github.event.inputs.message }}
token: ${{ secrets.GITHUB_TOKEN }}
tag:
uses: upbound/official-providers-ci/.github/workflows/provider-tag.yml@standard-runners
with:
version: ${{ github.event.inputs.version }}
message: ${{ github.event.inputs.message }}
Loading

0 comments on commit 92afae6

Please sign in to comment.