Skip to content

Commit f64de2f

Browse files
authored
Switch to new upbound devex (#81)
1 parent 7e085b2 commit f64de2f

File tree

30 files changed

+620
-536
lines changed

30 files changed

+620
-536
lines changed

.github/workflows/ci.yaml

Lines changed: 29 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,69 +4,45 @@ on:
44
push:
55
branches:
66
- main
7-
- release-*
8-
workflow_dispatch: {}
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: Package version (e.g. v0.1.0)
11+
required: false
912

1013
env:
11-
DOCKER_BUILDX_VERSION: 'v0.8.2'
12-
13-
XPKG_ACCESS_ID: ${{ secrets.XPKG_ACCESS_ID }}
14+
UP_API_TOKEN: ${{ secrets.UP_API_TOKEN }}
15+
UP_ROBOT_ID: ${{ secrets.UP_ROBOT_ID }}
16+
UP_ORG: ${{ secrets.UP_ORG }}
1417

1518
jobs:
16-
detect-noop:
17-
runs-on: ubuntu-24.04
18-
outputs:
19-
noop: ${{ steps.noop.outputs.should_skip }}
20-
steps:
21-
- name: Detect No-op Changes
22-
id: noop
23-
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5.3.1
24-
with:
25-
github_token: ${{ secrets.GITHUB_TOKEN }}
26-
paths_ignore: '["**.md", "**.png", "**.jpg"]'
27-
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
28-
29-
publish-artifacts:
30-
runs-on: ubuntu-24.04
31-
needs: detect-noop
32-
if: needs.detect-noop.outputs.noop != 'true'
33-
19+
deploy:
20+
runs-on: ubuntu-latest
3421
steps:
35-
- name: Setup Docker Buildx
36-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
37-
with:
38-
version: ${{ env.DOCKER_BUILDX_VERSION }}
39-
install: true
40-
4122
- name: Checkout
23+
id: checkout
4224
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
43-
with:
44-
submodules: true
45-
46-
- name: Fetch History
47-
run: git fetch --prune --unshallow
4825

49-
- name: Build Artifacts
50-
run: make -j2 build.all
51-
env:
52-
# We're using docker buildx, which doesn't actually load the images it
53-
# builds by default. Specifying --load does so.
54-
BUILD_ARGS: "--load"
55-
56-
- name: Publish Artifacts to GitHub
57-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
26+
- name: Install and login with up
27+
if: env.UP_API_TOKEN != '' && env.UP_ORG != ''
28+
uses: upbound/action-up@53fe6395637d884c80d2bbc8c2d75d0ece776ced # v1
5829
with:
59-
name: output
60-
path: _output/**
30+
api-token: ${{ secrets.UP_API_TOKEN }}
31+
organization: ${{ secrets.UP_ORG }}
6132

62-
- name: Login to Upbound
63-
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
64-
if: env.XPKG_ACCESS_ID != ''
33+
# doesn't work with plain token when pushing otherwise
34+
- name: Login to xpkg with robot
35+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
6536
with:
6637
registry: xpkg.upbound.io
67-
username: ${{ secrets.XPKG_ACCESS_ID }}
68-
password: ${{ secrets.XPKG_TOKEN }}
38+
username: ${{ env.UP_ROBOT_ID }}
39+
password: ${{ env.UP_API_TOKEN }}
6940

70-
- name: Publish Artifacts
71-
if: env.XPKG_ACCESS_ID != ''
72-
run: make -j2 publish BRANCH_NAME=${GITHUB_REF##*/}
41+
- name: Build and Push Upbound project
42+
if: env.UP_API_TOKEN != ''
43+
uses: upbound/action-up-project@87016022642d4076f1360639bdf0f04527c28983 # v1
44+
with:
45+
push-project: true
46+
tag: ${{ inputs.version || '' }}
47+
# login-check does `up org list` which doesn't work with a robot-token
48+
skip-login-check: true
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Composition Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request: {}
8+
9+
jobs:
10+
composition-tests:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
id: checkout
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
16+
17+
- name: Install up
18+
uses: upbound/action-up@53fe6395637d884c80d2bbc8c2d75d0ece776ced # v1
19+
with:
20+
skip-login: true
21+
22+
- name: Build project
23+
run: up project build
24+
25+
- name: Run composition tests
26+
run: up test run tests/*

.github/workflows/e2e.yaml

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,50 @@
11
name: End to End Testing
22

33
on:
4-
issue_comment:
5-
types: [created]
4+
# https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
5+
# pull_request_target is potentially dangerous target so we keep it strict
6+
# under the label and benefit from secret propagation
7+
pull_request_target:
8+
types:
9+
- synchronize
10+
- labeled
11+
12+
env:
13+
UP_API_TOKEN: ${{ secrets.UP_E2E_API_TOKEN || secrets.UP_API_TOKEN }}
14+
UP_ORG: ${{ secrets.UP_E2E_ORG || secrets.UP_ORG }}
15+
UP_GROUP: ${{ secrets.UP_E2E_GROUP || secrets.UP_GROUP || 'default' }}
16+
UP_ROBOT_ID: ${{ secrets.UP_E2E_ROBOT_ID || secrets.UP_ROBOT_ID }}
617

718
jobs:
819
e2e:
9-
uses: upbound/official-providers-ci/.github/workflows/pr-comment-trigger.yml@main
10-
with:
11-
package-type: configuration
12-
secrets:
13-
UPTEST_CLOUD_CREDENTIALS: ${{ secrets.UPTEST_CLOUD_CREDENTIALS }}
14-
UPTEST_DATASOURCE: ${{ secrets.UPTEST_DATASOURCE }}
20+
if: contains(github.event.pull_request.labels.*.name, 'run-e2e-tests')
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
id: checkout
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
26+
27+
- name: Install and login with up
28+
if: env.UP_API_TOKEN != '' && env.UP_ORG != ''
29+
uses: upbound/action-up@53fe6395637d884c80d2bbc8c2d75d0ece776ced # v1
30+
with:
31+
api-token: ${{ env.UP_API_TOKEN }}
32+
organization: ${{ env.UP_ORG }}
33+
34+
# doesn't work with plain token when pushing otherwise
35+
- name: Login to xpkg with robot
36+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
37+
with:
38+
registry: xpkg.upbound.io
39+
username: ${{ env.UP_ROBOT_ID }}
40+
password: ${{ env.UP_API_TOKEN }}
41+
42+
- name: Build project
43+
run: up project build
44+
45+
- name: Switch up context
46+
run: up ctx ${{ env.UP_ORG }}/upbound-gcp-us-central-1/${{ env.UP_GROUP }}
47+
48+
- name: Run e2e tests
49+
if: env.UP_API_TOKEN != '' && env.UP_ORG != ''
50+
run: up test run tests/* --e2e

.github/workflows/yamllint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
steps:
88
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
99
- name: yamllint
10-
uses: reviewdog/action-yamllint@1dca3ad811867be18fbe293a9818d715a6c2cd46 # v1.20.0
10+
uses: reviewdog/action-yamllint@f01d8a48fd8d89f89895499fca2cff09f9e9e8c0 # v1.21.0
1111
with:
1212
reporter: github-pr-review
1313
filter_mode: nofilter

.gitignore

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
/.cache
2-
/.work
3-
/_output
4-
/results
5-
/.idea
6-
7-
*.xpkg
8-
kubeconfig
1+
_output
2+
.venv
3+
.up

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)