Skip to content

Commit

Permalink
Merge pull request #3 from SFDO-Tooling/main
Browse files Browse the repository at this point in the history
Merge CCI to Julian88Tex fork
  • Loading branch information
Julian88Tex authored Nov 26, 2024
2 parents d566d48 + e261563 commit 105f575
Show file tree
Hide file tree
Showing 126 changed files with 9,670 additions and 1,362 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/chores.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,34 @@ on:

jobs:
check_api_versions:
runs-on: sfdc-ubuntu-latest
runs-on: SFDO-Tooling-Ubuntu
outputs:
hub_version: ${{ steps.devhub-api-version.outputs.hub_version }}
cci_version: ${{ steps.cci-api-version.outputs.cci_version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
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: sfdc-ubuntu-latest
runs-on: SFDO-Tooling-Ubuntu
needs: check_api_versions
if: ${{ needs.check_api_versions.outputs.hub_version != needs.check_api_versions.outputs.cci_version }}
env:
VERSION: ${{ needs.check_api_versions.outputs.hub_version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
Expand All @@ -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 }}
69 changes: 40 additions & 29 deletions .github/workflows/feature_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,91 +11,102 @@ on:
jobs:
lint:
name: Lint
if: ${{ github.event_name == 'pull_request' }}
if: ${{ contains(fromJSON('["workflow_dispatch", "pull_request"]'), github.event_name) }}
uses: SFDO-Tooling/.github/.github/workflows/pre-commit.yml@main
docs:
name: Build Docs
if: ${{ github.event_name == 'pull_request' }}
runs-on: sfdc-ubuntu-latest
runs-on: SFDO-Tooling-Ubuntu
steps:
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python 3.8
- name: Set up Python 3.11
id: py
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: pip
cache-dependency-path: "requirements/*.txt"
python-version: 3.11
- name: Set up uv
uses: SFDO-Tooling/setup-uv@main
with:
version: "0.5.0"
enable-cache: true
- name: Install dependencies
run: pip install -r requirements_dev.txt
run: uv sync --group docs
- name: Build Docs
run: make docs
run: |
cd docs
uv run sphinx-build -b html . ./_build
unit_tests:
name: "Unit tests: ${{ matrix.os }}-${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, sfdc-ubuntu-latest, sfdc-windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [macos-latest, SFDO-Tooling-Ubuntu, SFDO-Tooling-Windows]
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
cache: pip
cache-dependency-path: "requirements/*.txt"
- name: Set up uv
uses: SFDO-Tooling/setup-uv@main
with:
version: "0.5.0"
enable-cache: true
- name: Install dependencies
run: pip install -r requirements_dev.txt
run: uv sync -p ${{ matrix.python-version }}
- name: Run Pytest
run: pytest --cov-report= --cov=cumulusci
run: uv run pytest --cov-report= --cov=cumulusci

robot_api:
name: "Robot: No browser"
runs-on: sfdc-ubuntu-latest
runs-on: SFDO-Tooling-Ubuntu
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: pip
cache-dependency-path: "requirements/*.txt"
- name: Install Python dependencies
run: pip install -r requirements_dev.txt
python-version: 3.11
- name: Set up uv
uses: SFDO-Tooling/setup-uv@main
with:
version: "0.5.0"
enable-cache: true
- name: Install dependencies
run: uv sync -p 3.11
- name: Install sfdx
run: |
mkdir sfdx
wget -qO- https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-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
sf 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
sf org login jwt --client-id $SFDX_CLIENT_ID --jwt-key-file sfdx.key --username $SFDX_HUB_USERNAME --setdefaultdevhubusername -a hub
env:
SFDX_HUB_KEY_BASE64: ${{ secrets.SFDX_HUB_KEY_BASE64 }}
SFDX_CLIENT_ID: ${{ secrets.SFDX_CLIENT_ID }}
SFDX_HUB_USERNAME: ${{ secrets.SFDX_HUB_USERNAME }}
- name: Run robot tests
run: |
coverage run --append $(which cci) task run robot \
uv run cci task run robot \
--org dev \
-o name "CumulusCI" \
-o suites cumulusci/robotframework/tests \
-o include no-browser
- name: Delete scratch org
if: always()
run: |
cci org scratch_delete dev
uv run cci org scratch_delete dev
- name: Store robot results
if: failure()
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: robot
path: robot/CumulusCI/results
6 changes: 3 additions & 3 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ on:
jobs:
generate-changelog:
name: Create a PR to update version and release notes
runs-on: sfdc-ubuntu-latest
runs-on: SFDO-Tooling-Ubuntu
steps:
- uses: actions/checkout@main
- name: Set up Python 3.8
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.11
cache: pip
- name: Install build tool
run: python -m pip install hatch
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ concurrency: publishing
jobs:
publish-to-pypi:
name: Publish new release to PyPI
runs-on: sfdc-ubuntu-latest
runs-on: SFDO-Tooling-Ubuntu
steps:
- uses: actions/checkout@main
- name: Set up Python 3.8
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.11
cache: pip
- name: Install build tools
run: python -m pip install hatch tomli tomli-w
- name: Pin dependencies
run: python utility/pin_dependencies.py
- name: Build source tarball and binary wheel
run: hatch build -c
- name: Upload to PyPI
Expand Down
89 changes: 16 additions & 73 deletions .github/workflows/release_test.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,22 @@
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:
name: "Test Package Artifacts"
runs-on: sfdc-ubuntu-latest
runs-on: SFDO-Tooling-Ubuntu
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.11
cache: pip
cache-dependency-path: "requirements/*.txt"
cache-dependency-path: "pyproject.toml"
- name: Install build tools
run: pip install hatch
- name: Test source tarball and binary wheel
Expand All @@ -67,45 +41,14 @@ jobs:

test_release:
name: "Test Release Flows"
runs-on: sfdc-ubuntu-latest
concurrency: release
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: pip
cache-dependency-path: "requirements/*.txt"
- name: Install Python dependencies
run: pip install -r requirements_dev.txt
- 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
coverage run --append --rcfile=../pyproject.toml --source=../cumulusci $(which cci) flow run ci_feature --org scratch --delete-org
- name: Run ci_beta flow
run: |
cd CumulusCI-Test
coverage run --append --rcfile=../pyproject.toml --source=../cumulusci $(which cci) flow run ci_beta --org scratch --delete-org
- name: Run ci_master flow
run: |
cd CumulusCI-Test
coverage run --append --rcfile=../pyproject.toml --source=../cumulusci $(which 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
coverage run --append --rcfile=../pyproject.toml --source=../cumulusci $(which 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 }}
Loading

0 comments on commit 105f575

Please sign in to comment.