Merge branch 'feature/release-artifacts' of github.com:muselab-d2x/Cu… #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Feature Test 🚀🔍 | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, synchronize, reopened] # Default | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
lint: | ||
name: 🔍 Lint Code | ||
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: ${{ github.repository_owner == 'SFDO-Tooling' && 'SFDO-Tooling-Ubuntu' || 'ubuntu-latest' }} | ||
steps: | ||
- name: 📦 Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: 🐍 Set up Python 3.8 | ||
id: py | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
cache: pip | ||
cache-dependency-path: "requirements/*.txt" | ||
- name: 📥 Install dependencies | ||
run: | | ||
echo "Installing dependencies..." | ||
pip install -r requirements_dev.txt | ||
- name: 📚 Build Docs | ||
run: | | ||
echo "Building documentation..." | ||
make docs | ||
unit_tests: | ||
name: 🧪 Unit Tests: ${{ matrix.os }}-${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest, SFDO-Tooling-Ubuntu, SFDO-Tooling-Windows] | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
exclude: | ||
- os: macos-latest | ||
python-version: 3.8 | ||
include: | ||
- os: macos-13 | ||
python-version: 3.8 | ||
steps: | ||
- name: 📦 Checkout Code | ||
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: 📥 Install dependencies | ||
run: | | ||
echo "Installing dependencies..." | ||
pip install -r requirements_dev.txt | ||
- name: ▶️ Run Pytest | ||
run: | | ||
echo "Running Pytest..." | ||
pytest --cov-report= --cov=cumulusci | ||
robot_api: | ||
name: 🤖 Robot Tests: No Browser | ||
runs-on: ${{ github.repository_owner == 'SFDO-Tooling' && 'SFDO-Tooling-Ubuntu' || 'ubuntu-latest' }} | ||
steps: | ||
- name: 📦 Checkout Code | ||
uses: actions/checkout@v4 | ||
- 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: | | ||
echo "Installing dependencies..." | ||
pip install -r requirements_dev.txt | ||
- name: ⚙️ Install sfdx | ||
run: | | ||
echo "Installing Salesforce CLI..." | ||
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: | | ||
echo "Authenticating Dev Hub..." | ||
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 --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: | | ||
echo "Running robot tests..." | ||
coverage run --append $(which 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: | | ||
echo "Deleting scratch org..." | ||
cci org scratch_delete dev | ||
- name: 📤 Store robot results | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: robot | ||
path: robot/CumulusCI/results |