D2X's Release 2GP flow could be optimized by splitting into separate jobs. The advantages include:
- Faster build times by running jobs in parallel
- Better integration into GitHub's web user experience for viewing Actions Workflow executions
- Retry only failed jobs instead of re-running everything (release promotion + test)
This sets up the reusable workflow as callable and requires the dev-hub-auth-url secret:
name: Release 2GP
on:
workflow_call:
secrets:
dev-hub-auth-url:
required: trueThen, everything runs serially in a single job:
jobs:
release-test:
name: "Release 2GP"
runs-on: ubuntu-latest
container:
image: ghcr.io/muselab-d2x/d2x:latest
options: --user root
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github-token }}
env:
DEV_HUB_AUTH_URL: "${{ secrets.dev-hub-auth-url }}"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Auth to DevHub
run: /usr/local/bin/devhub.sh
- name: Set default org
run: cci org default releaseThe next step creates a scratch org and installs dependencies to prepare it for the release test:
- name: Install Dependencies for Resolution
run: cci flow run dependenciesInstalling dependencies could happen in parallel with promoting and publishing the release to GitHub but we can't because we're stuck in a single job:
- name: Promote Latest Beta
run: cci flow run release_2gp_production
shell: bashRelease testing could be faster if dependencies were preinstalling in parallel with release creation:
- name: Run Release Test
run: cci flow run ci_releaseAnd finally, scratch org deletion would be nicer as its own Job in the GitHub Actions UI:
- name: Delete Scratch Org
if: ${{ always() }}
run: |
cci org scratch_delete release
shell: bash