Skip to content

Commit

Permalink
Test SFDX release candidate every week
Browse files Browse the repository at this point in the history
This commit extracts the SFDX integration tests into a reusable workflow
so that we can test against the SFDX CLI's release candidates. It is
intended to provide early warning of breaking changes.
  • Loading branch information
jstvz committed Nov 15, 2024
1 parent 5ae0e51 commit 414ef6d
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 78 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/chores.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,18 @@ jobs:
- uses: actions/checkout@v3
with:
ref: main
- name: Set up Python
uses: actions/setup-python@v4
- name: Get Dev Hub API Version
id: devhub-api-version
env:
HUB_URL: ${{ format('{0}/services/data', secrets.SFDO_HUB_URL) }}
run: |
version=$(curl -s $HUB_URL | jq -r '.[-1] | .version')
echo "::set-output name=hub_version::$version"
echo "hub_version=$version" >> $GITHUB_OUTPUT
- name: Get CURRENT_SF_API_VERSION
id: cci-api-version
run: |
version=$(yq '.project.package.api_version' cumulusci/cumulusci.yml)
echo "::set-output name=cci_version::$version"
echo "cci_version=$version" >> $GITHUB_OUTPUT
update_api_versions:
runs-on: SFDO-Tooling-Ubuntu
needs: check_api_versions
Expand Down Expand Up @@ -58,3 +56,15 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create --fill --label 'auto-pr'
test_sfdx_release_candidate:
uses: ./.github/workflows/release_test_sfdx.yml
with:
sfdx-release-channel: stable-rc
secrets:
CUMULUSCI_ORG_packaging: ${{ secrets.CUMULUSCI_ORG_packaging }}
CUMULUSCI_SERVICE_github: ${{ secrets.CUMULUSCI_SERVICE_github }}
CCITEST_APP_KEY: ${{ secrets.CCITEST_APP_KEY }}
SFDX_CLIENT_ID: ${{ secrets.SFDX_CLIENT_ID }}
SFDX_HUB_KEY: ${{ secrets.SFDX_HUB_KEY }}
SFDX_HUB_KEY_BASE64: ${{ secrets.SFDX_HUB_KEY_BASE64 }}
SFDX_HUB_USERNAME: ${{ secrets.SFDX_HUB_USERNAME }}
86 changes: 12 additions & 74 deletions .github/workflows/release_test.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,9 @@
name: Release Test

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened] # Default
workflow_call:
secrets:
CUMULUSCI_ORG_packaging:
required: true
CUMULUSCI_SERVICE_github:
required: true
CCITEST_APP_KEY:
required: true
SFDX_CLIENT_ID:
required: true
SFDX_HUB_KEY:
required: true
SFDX_HUB_KEY_BASE64:
required: true
SFDX_HUB_USERNAME:
required: true

env:
CUMULUSCI_ORG_scratch: '{"config_file": "orgs/dev.json", "scratch": true}'
CUMULUSCI_ORG_packaging: ${{ secrets.CUMULUSCI_ORG_packaging }}
CUMULUSCI_SERVICE_github: ${{ secrets.CUMULUSCI_SERVICE_github }}
GITHUB_APP_ID: 129383
GITHUB_APP_KEY: ${{ secrets.CCITEST_APP_KEY }}
SFDX_CLIENT_ID: ${{ secrets.SFDX_CLIENT_ID }}
SFDX_HUB_KEY: ${{ secrets.SFDX_HUB_KEY }}
SFDX_HUB_KEY_BASE64: ${{ secrets.SFDX_HUB_KEY_BASE64 }}
SFDX_HUB_USERNAME: ${{ secrets.SFDX_HUB_USERNAME }}

jobs:
test_artifacts:
Expand Down Expand Up @@ -67,50 +41,14 @@ jobs:

test_release:
name: "Test Release Flows"
runs-on: SFDO-Tooling-Ubuntu
concurrency: release
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: pip
cache-dependency-path: "pyproject.toml"
- name: Set up uv
uses: SFDO-Tooling/setup-uv@main
with:
version: "0.5.0"
enable-cache: true
- name: Install Python dependencies
run: uv sync
- name: Install sfdx
run: |
mkdir sfdx
wget -qO- https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz | tar xJ -C sfdx --strip-components 1
echo $(realpath sfdx/bin) >> $GITHUB_PATH
- name: Authenticate Dev Hub
run: |
sfdx plugins --core
echo $SFDX_HUB_KEY_BASE64 | base64 --decode > sfdx.key
sfdx auth:jwt:grant --clientid $SFDX_CLIENT_ID --jwtkeyfile sfdx.key --username $SFDX_HUB_USERNAME --setdefaultdevhubusername -a hub
- name: Check out CumulusCI-Test
run: |
git clone https://github.com/SFDO-Tooling/CumulusCI-Test
- name: Run ci_feature flow
run: |
cd CumulusCI-Test
uv run cci flow run ci_feature --org scratch --delete-org
- name: Run ci_beta flow
run: |
cd CumulusCI-Test
uv run cci flow run ci_beta --org scratch --delete-org
- name: Run ci_master flow
run: |
cd CumulusCI-Test
uv run cci flow run ci_master --org scratch --delete-org
- name: Run release_beta flow
run: |
export SFDX_HUB_KEY="$(echo $SFDX_HUB_KEY_BASE64 | base64 --decode)"
cd CumulusCI-Test
uv run cci flow run release_beta --org packaging
uses: ./.github/workflows/release_test_sfdx.yml
with:
sfdx-release-channel: stable
secrets:
CUMULUSCI_ORG_packaging: ${{ secrets.CUMULUSCI_ORG_packaging }}
CUMULUSCI_SERVICE_github: ${{ secrets.CUMULUSCI_SERVICE_github }}
CCITEST_APP_KEY: ${{ secrets.CCITEST_APP_KEY }}
SFDX_CLIENT_ID: ${{ secrets.SFDX_CLIENT_ID }}
SFDX_HUB_KEY: ${{ secrets.SFDX_HUB_KEY }}
SFDX_HUB_KEY_BASE64: ${{ secrets.SFDX_HUB_KEY_BASE64 }}
SFDX_HUB_USERNAME: ${{ secrets.SFDX_HUB_USERNAME }}
88 changes: 88 additions & 0 deletions .github/workflows/release_test_sfdx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: SFDX Integration Test

on:
workflow_call:
inputs:
sfdx-release-channel:
required: false
type: string
default: stable
secrets:
CUMULUSCI_ORG_packaging:
required: true
CUMULUSCI_SERVICE_github:
required: true
CCITEST_APP_KEY:
required: true
SFDX_CLIENT_ID:
required: true
SFDX_HUB_KEY:
required: true
SFDX_HUB_KEY_BASE64:
required: true
SFDX_HUB_USERNAME:
required: true

env:
CUMULUSCI_ORG_scratch: '{"config_file": "orgs/dev.json", "scratch": true}'
CUMULUSCI_ORG_packaging: ${{ secrets.CUMULUSCI_ORG_packaging }}
CUMULUSCI_SERVICE_github: ${{ secrets.CUMULUSCI_SERVICE_github }}
GITHUB_APP_ID: 129383
GITHUB_APP_KEY: ${{ secrets.CCITEST_APP_KEY }}
SFDX_CLIENT_ID: ${{ secrets.SFDX_CLIENT_ID }}
SFDX_HUB_KEY: ${{ secrets.SFDX_HUB_KEY }}
SFDX_HUB_KEY_BASE64: ${{ secrets.SFDX_HUB_KEY_BASE64 }}
SFDX_HUB_USERNAME: ${{ secrets.SFDX_HUB_USERNAME }}

jobs:
test_release:
name: "Test SFDX CLI"
runs-on: sfdc-ubuntu-latest
concurrency: release
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: pip
cache-dependency-path: "pyproject.toml"
- name: Set up uv
uses: SFDO-Tooling/setup-uv@main
with:
version: "0.5.0"
enable-cache: true
- name: Install Python dependencies
run: uv sync
- name: Install sfdx
env:
CHANNEL: ${{ inputs.sfdx-release-channel }}
run: |
mkdir sfdx
wget -qO- https://developer.salesforce.com/media/salesforce-cli/sf/channels/$CHANNEL/sf-linux-x64.tar.xz | tar xJ -C sfdx --strip-components 1
echo $(realpath sfdx/bin) >> $GITHUB_PATH
- name: Authenticate Dev Hub
run: |
sf plugins --core
echo $SFDX_HUB_KEY_BASE64 | base64 --decode > sfdx.key
sf org login jwt --client-id $SFDX_CLIENT_ID --jwt-key-file sfdx.key --username $SFDX_HUB_USERNAME --set-default-dev-hub --alias hub
- name: Check out CumulusCI-Test
run: |
git clone https://github.com/SFDO-Tooling/CumulusCI-Test
- name: Run ci_feature flow
run: |
cd CumulusCI-Test
uv run cci flow run ci_feature --org scratch --delete-org
- name: Run ci_beta flow
run: |
cd CumulusCI-Test
uv run cci flow run ci_beta --org scratch --delete-org
- name: Run ci_master flow
run: |
cd CumulusCI-Test
uv run cci flow run ci_master --org scratch --delete-org
- name: Run release_beta flow
run: |
export SFDX_HUB_KEY="$(echo $SFDX_HUB_KEY_BASE64 | base64 --decode)"
cd CumulusCI-Test
uv run cci flow run release_beta --org packaging

0 comments on commit 414ef6d

Please sign in to comment.