Skip to content

Commit a8bfc0a

Browse files
authored
🔄 synced file(s) with upbound/sa-up (#17)
* 🔄 synced local '.github/workflows' with remote 'gitops/shared-files/configurations-new-devex/workflows' * 🔄 synced local '.github/renovate.json5' with remote 'gitops/shared-files/configurations-new-devex/renovate.json5' * 🔄 synced local '.yamllint' with remote 'gitops/shared-files/configurations-new-devex/.yamllint' --------- Co-authored-by: upbound-bot <null>
1 parent c74cd5e commit a8bfc0a

File tree

7 files changed

+178
-106
lines changed

7 files changed

+178
-106
lines changed

.github/renovate.json5

Lines changed: 61 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,69 @@
11
{
2-
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": [
4-
"config:recommended",
5-
"helpers:pinGitHubActionDigests",
6-
":semanticCommits"
2+
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
3+
extends: [
4+
'config:recommended',
5+
'helpers:pinGitHubActionDigests',
6+
':semanticCommits',
77
],
8-
"rebaseWhen": "conflicted",
9-
"prConcurrentLimit": 5,
10-
"baseBranches": ["main"],
11-
"labels": ["automated"],
12-
"customManagers": [
8+
rebaseWhen: 'auto',
9+
rebaseLabel: 'rebase',
10+
prConcurrentLimit: 5,
11+
autoApprove: true,
12+
automerge: true,
13+
automergeType: 'pr',
14+
baseBranches: [
15+
'main',
16+
],
17+
labels: [
18+
'automated',
19+
'run-e2e-tests',
20+
],
21+
ignorePaths: [ // default renovate ignorePaths without '**/examples/**'
22+
'**/node_modules/**',
23+
'**/bower_components/**',
24+
'**/vendor/**',
25+
'**/__tests__/**',
26+
'**/test/**',
27+
'**/tests/**',
28+
'**/__fixtures__/**'
29+
],
30+
crossplane: {
31+
fileMatch: ['(^|/)examples/.*\\.ya?ml$']
32+
},
33+
packageRules: [
34+
{
35+
matchFileNames: [
36+
'.github/**',
37+
],
38+
groupName: 'github-actions dependencies',
39+
},
1340
{
14-
"customType": "regex",
15-
"description": "Bump up version in the Makefile",
16-
"fileMatch": ["^Makefile$"],
17-
"matchStrings": [
18-
"UP_VERSION = (?<currentValue>.*?)\\n"
41+
matchFileNames: [
42+
'upbound.yaml',
1943
],
20-
"datasourceTemplate": "github-releases",
21-
"depNameTemplate": "upbound/up",
22-
}, {
23-
"customType": "regex",
24-
"description": "Bump uptest version in the Makefile",
25-
"fileMatch": ["^Makefile$"],
26-
"matchStrings": [
27-
"UPTEST_VERSION = (?<currentValue>.*?)\\n"
44+
groupName: 'crossplane dependencies',
45+
},
46+
{
47+
matchManagers: ['crossplane'],
48+
matchFileNames: ['examples/**'],
49+
groupName: 'examples'
50+
},
51+
],
52+
customManagers: [
53+
{
54+
customType: 'regex',
55+
description: 'Bump providers/functions/configurations in upbound.yaml',
56+
fileMatch: [
57+
'upbound.yaml',
2858
],
29-
"datasourceTemplate": "github-releases",
30-
"depNameTemplate": "upbound/uptest",
31-
}, {
32-
"customType": "regex",
33-
"description": "Bump providers/functions/configurations in crossplane.yaml",
34-
"fileMatch": ["crossplane.yaml"],
35-
"matchStrings": [
36-
"#\\s*renovate:\\s*datasource=(?<datasource>[^\\s]+)\\s+depName=(?<depName>[^\\s]+)\\s*\\n\\s*version:\\s*\"(?<currentValue>[^\"]+)\""
59+
matchStrings: [
60+
'#\\s*renovate:\\s*datasource=(?<datasource>[^\\s]+)\\s+depName=(?<depName>[^\\s]+)\\s*\\n\\s*version:\\s*"(?<currentValue>[^"]+)"',
3761
],
38-
"datasourceTemplate": "{{{datasource}}}",
39-
"depNameTemplate": "{{{depName}}}",
40-
}
62+
datasourceTemplate: '{{{datasource}}}',
63+
depNameTemplate: '{{{depName}}}',
64+
},
4165
],
66+
"git-submodules": {
67+
"enabled": true
68+
}
4269
}

.github/workflows/ci.yaml

Lines changed: 39 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,73 +4,53 @@ 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-
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 }}
17+
XPKG_REGISTRY: xpkg.upbound.io
1318

1419
jobs:
15-
detect-noop:
16-
runs-on: ubuntu-22.04
17-
outputs:
18-
noop: ${{ steps.noop.outputs.should_skip }}
20+
deploy:
21+
runs-on: ubuntu-latest
1922
steps:
20-
- name: Detect No-op Changes
21-
id: noop
22-
uses: fkirc/[email protected]
23-
with:
24-
github_token: ${{ secrets.GITHUB_TOKEN }}
25-
paths_ignore: '["**.md", "**.png", "**.jpg"]'
26-
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
27-
28-
publish-artifacts:
29-
runs-on: ubuntu-22.04
30-
needs: detect-noop
31-
if: needs.detect-noop.outputs.noop != 'true'
32-
33-
steps:
34-
- name: Setup QEMU
35-
uses: docker/setup-qemu-action@v1
36-
with:
37-
platforms: all
38-
39-
- name: Setup Docker Buildx
40-
uses: docker/setup-buildx-action@v1
41-
with:
42-
version: ${{ env.DOCKER_BUILDX_VERSION }}
43-
install: true
44-
4523
- name: Checkout
46-
uses: actions/checkout@v2
47-
with:
48-
submodules: true
24+
id: checkout
25+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
4926

50-
- name: Fetch History
51-
run: git fetch --prune --unshallow
52-
53-
- name: Build Artifacts
54-
run: make -j2 build.all
55-
env:
56-
# We're using docker buildx, which doesn't actually load the images it
57-
# builds by default. Specifying --load does so.
58-
BUILD_ARGS: "--load"
59-
60-
- name: Publish Artifacts to GitHub
61-
uses: actions/upload-artifact@v2
27+
- name: Install and login with up
28+
if: env.UP_API_TOKEN != '' && env.UP_ORG != ''
29+
uses: upbound/action-up@53fe6395637d884c80d2bbc8c2d75d0ece776ced # v1
6230
with:
63-
name: output
64-
path: _output/**
31+
api-token: ${{ secrets.UP_API_TOKEN }}
32+
organization: ${{ secrets.UP_ORG }}
6533

66-
- name: Login to Upbound
67-
uses: docker/login-action@v1
68-
if: env.XPKG_ACCESS_ID != ''
34+
# doesn't work with plain token when pushing otherwise
35+
- name: Login to xpkg with robot
36+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
6937
with:
70-
registry: xpkg.upbound.io
71-
username: ${{ secrets.XPKG_ACCESS_ID }}
72-
password: ${{ secrets.XPKG_TOKEN }}
38+
registry: ${{ env.XPKG_REGISTRY }}
39+
username: ${{ env.UP_ROBOT_ID }}
40+
password: ${{ env.UP_API_TOKEN }}
7341

74-
- name: Publish Artifacts
75-
if: env.XPKG_ACCESS_ID != ''
76-
run: make -j2 publish BRANCH_NAME=${GITHUB_REF##*/}
42+
- name: Build and Push Upbound project
43+
if: env.UP_API_TOKEN != ''
44+
uses: upbound/action-up-project@b849ec1eb303ae4abf22b2b86c0e2afca155137b # v1
45+
with:
46+
push-project: true
47+
tag: ${{ inputs.version || '' }}
48+
# login-check does `up org list` which doesn't work with a robot-token
49+
skip-login-check: true
50+
51+
- name: Append icon overlay to package
52+
if: env.UP_API_TOKEN != '' && hashFiles('./extensions') != '' && inputs.version != ''
53+
run: |
54+
PROJECT_NAME=$(yq '.metadata.name' upbound.yaml)
55+
PACKAGE_REF="${{ env.XPKG_REGISTRY }}/${{ env.UP_ORG }}/${PROJECT_NAME}:${{ inputs.version }}"
56+
up alpha xpkg append --extensions-root=./extensions ${PACKAGE_REF}
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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
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: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,51 @@
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/uptest/.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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
26+
with:
27+
ref: ${{ github.event.pull_request.head.sha }}
28+
29+
- name: Install and login with up
30+
if: env.UP_API_TOKEN != '' && env.UP_ORG != ''
31+
uses: upbound/action-up@53fe6395637d884c80d2bbc8c2d75d0ece776ced # v1
32+
with:
33+
api-token: ${{ env.UP_API_TOKEN }}
34+
organization: ${{ env.UP_ORG }}
35+
36+
# doesn't work with plain token when pushing otherwise
37+
- name: Login to xpkg with robot
38+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
39+
with:
40+
registry: xpkg.upbound.io
41+
username: ${{ env.UP_ROBOT_ID }}
42+
password: ${{ env.UP_API_TOKEN }}
43+
44+
- name: Build project
45+
run: up project build
46+
47+
- name: Switch up context
48+
run: up ctx ${{ env.UP_ORG }}/upbound-gcp-us-central-1/${{ env.UP_GROUP }}
49+
50+
- name: Run e2e tests
51+
run: up test run tests/* --e2e

.github/workflows/tag.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ on:
1212

1313
jobs:
1414
create-tag:
15-
runs-on: ubuntu-22.04
15+
runs-on: ubuntu-24.04
1616

1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2020

2121
- name: Create Tag
22-
uses: negz/create-tag@v1
22+
uses: negz/create-tag@39bae1e0932567a58c20dea5a1a0d18358503320 # v1
2323
with:
2424
version: ${{ github.event.inputs.version }}
2525
message: ${{ github.event.inputs.message }}

.github/workflows/yamllint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ jobs:
55
name: runner / yamllint
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v4
8+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
99
- name: yamllint
10-
uses: reviewdog/action-yamllint@v1.9.0
10+
uses: reviewdog/action-yamllint@f01d8a48fd8d89f89895499fca2cff09f9e9e8c0 # v1.21.0
1111
with:
1212
reporter: github-pr-review
1313
filter_mode: nofilter

.yamllint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ extends: default
33
rules:
44
line-length: disable
55
document-start: disable
6+
indentation:
7+
indent-sequences: consistent

0 commit comments

Comments
 (0)