Skip to content

Commit

Permalink
Merge branch 'cumulusci-next-snapshots' into jlantz/update-auth-struc…
Browse files Browse the repository at this point in the history
…ture
  • Loading branch information
jlantz authored Nov 1, 2024
2 parents 8462b62 + 7fb7f49 commit 18a8543
Show file tree
Hide file tree
Showing 54 changed files with 2,947 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/beta-test-2gp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
GITHUB_APP_KEY: "${{ secrets.github-app-key }}"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Auth to DevHub
run: /usr/local/bin/devhub.sh
- name: Set default org
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/beta-test-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
required: true
default: 1GP Packaging Beta
type: string

run-test:
description: If true, run the ci_beta flow to test the beta as part of the job. Set to false to split ci_beta into a separate workflow
default: true
type: boolean
debug:
required: false
default: false
Expand All @@ -20,6 +25,11 @@ on:
required: true
github-token:
required: true
github-app-id:
required: false
github-app-key:
required: false


jobs:
beta-test:
Expand All @@ -36,9 +46,13 @@ jobs:
DEV_HUB_AUTH_URL: "${{ secrets.dev-hub-auth-url }}"
PACKAGING_ORG_AUTH_URL: "${{ secrets.packaging-org-auth-url }}"
CUMULUSCI_SERVICE_github: '{ "username": "${{ github.actor }}", "token": "${{ secrets.github-token }}", "email": "${{ secrets.gh-email }}" }'

GITHUB_APP_ID: "${{ secrets.github-app-id }}"
GITHUB_APP_KEY: "${{ secrets.github-app-key }}"

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Auth to DevHub
run: /usr/local/bin/devhub.sh
- name: Deploy to Packaging Org
Expand All @@ -47,9 +61,10 @@ jobs:
run: cci flow run release_beta --org packaging $([[ "${{ inputs.debug }}" == "true" ]] && echo " --debug")
shell: bash
- name: Run Beta Test
if: ${{ inputs.run-test }}
run: cci flow run ci_beta --org beta
- name: Delete Scratch Org
if: ${{ always() }}
if: ${{ always() }} && ${{ inputs.run-test }}
run: |
cci org scratch_delete beta
shell: bash
50 changes: 50 additions & 0 deletions .github/workflows/beta-test-scratch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Beta Test

on:
workflow_call:
inputs:
debug:
required: false
default: false
type: boolean
secrets:
dev-hub-auth-url:
required: true
gh-email:
required: true
github-token:
required: true
github-app-id:
required: false
github-app-key:
required: false

jobs:
beta-test:
name: "Beta Test in Scratch Org"
runs-on: ubuntu-latest
environment: ${{ inputs.env-name }}
container:
image: ghcr.io/muselab-d2x/d2x:cumulusci-next
options: --user root
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github-token }}
env:
DEV_HUB_AUTH_URL: "${{ secrets.dev-hub-auth-url }}"
PACKAGING_ORG_AUTH_URL: "${{ secrets.packaging-org-auth-url }}"
CUMULUSCI_SERVICE_github: '{ "username": "${{ github.actor }}", "token": "${{ secrets.github-token }}", "email": "${{ secrets.gh-email }}" }'
GITHUB_APP_ID: "${{ secrets.github-app-id }}"
GITHUB_APP_KEY: "${{ secrets.github-app-key }}"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Auth to DevHub
run: /usr/local/bin/devhub.sh
- name: Run Beta Test
run: cci flow run ci_beta --org beta
- name: Delete Scratch Org
if: ${{ always() }}
run: |
cci org scratch_delete beta
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/beta-test-unlocked.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
CUMULUSCI_SERVICE_github: '{ "username": "${{ github.actor }}", "token": "${{ secrets.github-token }}", "email": "${{ secrets.gh-email }}" }'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Auth to DevHub
run: /usr/local/bin/devhub.sh
- name: Set default org
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/beta-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ on:
github-token:
required: true

github-app-id:
required: false
github-app-key:
required: false


jobs:
beta-test:
name: "Beta Test"
Expand All @@ -26,9 +32,13 @@ jobs:
DEV_HUB_AUTH_URL: "${{ secrets.dev-hub-auth-url }}"
PACKAGING_ORG_AUTH_URL: "${{ secrets.packaging-org-auth-url }}"
CUMULUSCI_SERVICE_github: '{ "username": "${{ github.actor }}", "token": "${{ secrets.github-token }}", "email": "${{ secrets.gh-email }}" }'

GITHUB_APP_ID: "${{ secrets.github-app-id }}"
GITHUB_APP_KEY: "${{ secrets.github-app-key }}"

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Auth to DevHub
run: /usr/local/bin/devhub.sh
- name: Deploy to Packaging Org
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/check-no-org.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Check No Org

on:
workflow_call:
inputs:
debug:
description: "Enable debug logging output for CumulusCI"
required: false
default: false
type: boolean
secrets:
github-token:
required: true

jobs:
check-no-org:
name: "Check No Org"
runs-on: ubuntu-latest
container:
image: ghcr.io/muselab-d2x/d2x:cumulusci-next-snapshots
options: --user root
credentials:
username: "${{ github.actor }}"
password: "${{ secrets.github-token }}"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Checks
run: |
set -e {
cci task run check_no_org \
$([[ "${{ inputs.debug }}" == "true" ]] && echo " --debug")
} || {
echo "::error::Failed to run checks. Running cci error info..."
cci error info
exit 1
}
shell: bash
73 changes: 73 additions & 0 deletions .github/workflows/configure-org-for-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Configure Org for Testing

on:
workflow_call:
inputs:
org:
required: false
default: feature
type: string
debug:
required: false
default: false
type: boolean
secrets:
dev-hub-auth-url:
required: false
dev-hub-username:
required: false
dev-hub-client-id:
required: false
dev-hub-private-key:
required: false
gh-email:
required: true
github-token:
required: true
github-app-id:
required: false
github-app-key:
required: false

jobs:
configure-org-for-testing:
name: "Configure Org for Testing"
runs-on: ubuntu-latest
container:
image: ghcr.io/muselab-d2x/d2x:cumulusci-next-snapshots
options: --user root
credentials:
username: "${{ github.actor }}"
password: "${{ secrets.github-token }}"
steps:
- name: D2X Image Details
run: |
echo "D2X Docker Image: ghcr.io/muselab-d2x/d2x"
echo "D2X Docker Tag: cumulusci-next-snapshots"
echo "D2X Docker Image: ghcr.io/muselab-d2x/d2x:cumulusci-next-snapshots" >> $GITHUB_STEP_SUMMARY
shell: bash

- name: Checkout
uses: actions/checkout@v4

- name: Auth to DevHub
run: /usr/local/bin/devhub.sh
env:
DEV_HUB_AUTH_URL: "${{ secrets.dev-hub-auth-url }}"
DEV_HUB_USERNAME: "${{ secrets.dev-hub-username }}"
DEV_HUB_CLIENT_ID: "${{ secrets.dev-hub-client-id }}"
DEV_HUB_PRIVATE_KEY: "${{ secrets.dev-hub-private-key }}"

- name: Set ${{ inputs.org }} org as default org
run: cci org default ${{ inputs.org }}

- name: Configure Org for Testing
id: configure_org
env:
GITHUB_TOKEN: "${{ secrets.github-token }}"
CUMULUSCI_SERVICE_github: '{ "username": "${{ github.actor }}", "token": "${{ secrets.github-token }}", "email": "${{ secrets.gh-email }}" }'
GITHUB_APP_ID: "${{ secrets.github-app-id }}"
GITHUB_APP_KEY: "${{ secrets.github-app-key }}"
run: |
cci flow run ci_feature_2gp --skip-from run-tests
shell: bash
88 changes: 88 additions & 0 deletions .github/workflows/create-feature-test-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Create Feature Test Package

on:
workflow_call:
inputs:
org:
required: false
default: feature
type: string
debug:
required: false
default: false
type: boolean
docker_image:
required: false
default: ghcr.io/muselab-d2x/d2x
type: string
docker_tag:
type: string
required: false
default: cumulusci-next-snapshots
secrets:
dev-hub-auth-url:
required: false
dev-hub-username:
required: false
dev-hub-client-id:
required: false
dev-hub-private-key:
required: false
gh-email:
required: true
github-token:
required: true
github-app-id:
required: false
github-app-key:
required: false

jobs:
create-feature-test-package:
name: "Create Feature Test Package"
runs-on: ubuntu-latest
container:
image: ${{ inputs.docker_image }}:${{ inputs.docker_tag }}
options: --user root
credentials:
username: "${{ github.actor }}"
password: "${{ secrets.github-token }}"
steps:
- name: D2X Image Details
run: |
echo "D2X Docker Image: ${{ inputs.docker_image }}"
echo "D2X Docker Tag: ${{ inputs.docker_tag }}"
echo "D2X Docker Image: `${{ inputs.docker_image }}:${{ inputs.docker_tag }}`" >> $GITHUB_STEP_SUMMARY
shell: bash
- name: Checkout
uses: actions/checkout@v4
- name: Auth to DevHub
run: /usr/local/bin/devhub.sh
env:
DEV_HUB_AUTH_URL: "${{ secrets.dev-hub-auth-url }}"
DEV_HUB_USERNAME: "${{ secrets.dev-hub-username }}"
DEV_HUB_CLIENT_ID: "${{ secrets.dev-hub-client-id }}"
DEV_HUB_PRIVATE_KEY: "${{ secrets.dev-hub-private-key }}"
- name: Set ${{ inputs.org }} org as default org
run: cci org default ${{ inputs.org }}
- name: Build Feature Test Package
env:
GITHUB_TOKEN: "${{ secrets.github-token }}"
CUMULUSCI_SERVICE_github: '{ "username": "${{ github.actor }}", "token": "${{ secrets.github-token }}", "email": "${{ secrets.gh-email }}" }'
GITHUB_APP_ID: "${{ secrets.github-app-id }}"
GITHUB_APP_KEY: "${{ secrets.github-app-key }}"
run: cci flow run build_feature_test_package $([[ "${{ inputs.debug }}" == "true" ]] && echo " --debug") | tee cumulusci-flow.log
shell: bash
- name: Set Commit Status
env:
GITHUB_TOKEN: "${{ secrets.github-token }}"
run: |
VERSION=$(cat cumulusci-flow.log | grep -o -E -m 1 "04t[a-zA-Z0-9]{15}")
gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
'/repos/${{ github.repository }}/statuses/${{ github.sha }}' \
-f state='success' \
-f description="version_id: $VERSION" \
-f context='Build Feature Test Package'
shell: bash
Loading

0 comments on commit 18a8543

Please sign in to comment.