Skip to content

ORCA CI

ORCA CI #1158

Workflow file for this run

---
name: ORCA CI
on:
push:
branches: [ main, develop, wip, support/**, release/**, hotfix/** ]
paths-ignore:
- .idea/**
- docs/**
pull_request:
branches: [ develop ]
paths-ignore:
- .idea/**
- docs/**
schedule:
# Daily at 00:00:00 UTC.
# @see https://crontab.cronhub.io/
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-24.04
env:
# Boolean values must be quoted, otherwise they will be converted to lower case and break ORCA scripts.
ORCA_SUT_NAME: drupal/example
ORCA_SUT_BRANCH: main
ORCA_PACKAGES_CONFIG: example/tests/packages.yml
ORCA_PACKAGES_CONFIG_ALTER: example/tests/packages_alter.yml
# Hardcode path since GITHUB_WORKSPACE can't be used here.
# @see https://github.saobby.my.eu.orgmunity/t/how-to-use-env-context/16975/9
ORCA_SUT_DIR: /home/runner/work/orca/example
ORCA_SELF_TEST_COVERAGE_COBERTURA: /home/runner/build/logs/cobertura.xml
ORCA_SELF_TEST_COVERAGE_CLOVER: /home/runner/build/logs/clover.xml
ORCA_JOB: ${{ matrix.orca-job }}
ORCA_ENABLE_NIGHTWATCH: ${{ matrix.orca-enable-nightwatch }}
ORCA_COVERAGE_COBERTURA_ENABLE: ${{ matrix.orca-coverage-cobertura-enable }}
ORCA_COVERAGE_CLOVER_ENABLE: ${{ matrix.orca-coverage-clover-enable }}
ORCA_COVERAGE_ENABLE: ${{ matrix.orca-coverage-enable }}
# Google env variables.
ORCA_GOOGLE_API_CLIENT_ID: ${{ secrets.ORCA_GOOGLE_API_CLIENT_ID }}
ORCA_GOOGLE_API_CLIENT_SECRET: ${{ secrets.ORCA_GOOGLE_API_CLIENT_SECRET }}
ORCA_GOOGLE_API_REFRESH_TOKEN: ${{ secrets.ORCA_GOOGLE_API_REFRESH_TOKEN }}
strategy:
matrix:
orca-job:
- STATIC_CODE_ANALYSIS
- INTEGRATED_TEST_ON_OLDEST_SUPPORTED
- INTEGRATED_TEST_ON_PREVIOUS_MINOR
- INTEGRATED_TEST_ON_LATEST_LTS
# - INTEGRATED_UPGRADE_TEST_FROM_PREVIOUS_MINOR
- INTEGRATED_TEST_ON_CURRENT
# - INTEGRATED_UPGRADE_TEST_TO_NEXT_MINOR
- ISOLATED_TEST_ON_CURRENT_DEV
- INTEGRATED_TEST_ON_CURRENT_DEV
- STRICT_DEPRECATED_CODE_SCAN
- ISOLATED_TEST_ON_NEXT_MINOR
- INTEGRATED_TEST_ON_NEXT_MINOR
# - ISOLATED_UPGRADE_TEST_TO_NEXT_MAJOR_BETA_OR_LATER
# - ISOLATED_UPGRADE_TEST_TO_NEXT_MAJOR_DEV
- DEPRECATED_CODE_SCAN_W_CONTRIB
- INTEGRATED_TEST_ON_NEXT_MINOR_DEV
- ISOLATED_TEST_ON_NEXT_MINOR_DEV
# - INTEGRATED_UPGRADE_TEST_TO_NEXT_MINOR_DEV
- LOOSE_DEPRECATED_CODE_SCAN
php-version: [ "8.3" ]
orca-enable-nightwatch: [ "FALSE" ]
orca-coverage-enable: [ "TRUE" ]
include:
# Testing Drupal 10 in php 8.3.
- orca-job: ISOLATED_TEST_ON_CURRENT
php-version: "8.3"
orca-enable-nightwatch: "TRUE"
# Testing coverage generation in CLOVER format.
orca-coverage-clover-enable: "TRUE"
# Testing Drupal 9 in php 8.1.
- orca-job: INTEGRATED_TEST_ON_LATEST_EOL_MAJOR
php-version: "8.1"
# Testing Drupal 10 in php 8.1.
- orca-job: INTEGRATED_TEST_ON_OLDEST_SUPPORTED
php-version: "8.1"
# Testing Drupal 10 in php 8.1.
- orca-job: INTEGRATED_TEST_ON_LATEST_LTS
php-version: "8.1"
# # Testing Drupal 11 in php 8.3.
# - orca-job: ISOLATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_BETA_OR_LATER
# php-version: "8.3"
#
# # Testing Drupal 11 in php 8.3.
# - orca-job: INTEGRATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_BETA_OR_LATER
# php-version: "8.3"
#
# # Testing Drupal 11 in php 8.3.
# - orca-job: ISOLATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_DEV
# php-version: "8.3"
#
# # Testing Drupal 11 in php 8.3.
# - orca-job: INTEGRATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_DEV
# php-version: "8.3"
steps:
- uses: actions/checkout@v3
- name: Install latest Yarn
run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: 20.x
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
- name: Setup Chrome
uses: browser-actions/setup-chrome@v1.7.2
id: setup-chrome
with:
chrome-version: 119
install-chromedriver: true
- run: |
CHROME_BIN="${{ steps.setup-chrome.outputs.chrome-path }}"
sudo ln -sf "$CHROME_BIN" /usr/bin/
CHROMEDRIVER_BIN="${{ steps.setup-chrome.outputs.chromedriver-path }}"
sudo ln -sf "$CHROMEDRIVER_BIN" /usr/bin/
# Commenting out to use the latest chrome and chromedriver versions.
# - name: Install google-chrome-stable
# run: |
# # Remove existing google chrome and install required version.
# sudo dpkg -r google-chrome-stable
# CHROME_VERSION_STRING="114.0.5735.198-1"
# wget --no-verbose -O /tmp/chrome.deb "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION_STRING}_amd64.deb" \
# && sudo apt install -y /tmp/chrome.deb \
# && sudo rm /tmp/chrome.deb
# sudo echo "CHROME_BIN=/usr/bin/google-chrome" | sudo tee -a /etc/environment
#
# # Download and unpack chromedriver.
# CHROME_DRIVER_VERSION_STRING="114.0.5735.90"
# CHROMEDRIVER_ARCHIVE="chromedriver_linux64.zip"
# CHROMEDRIVER_URL="https://chromedriver.storage.googleapis.com/${CHROME_DRIVER_VERSION_STRING}/${CHROMEDRIVER_ARCHIVE}"
# CHROMEDRIVER_DIR="/usr/local/share/chromedriver-linux64"
# CHROMEDRIVER_BIN="$CHROMEDRIVER_DIR/chromedriver"
# sudo rm -rf $CHROMEDRIVER_DIR
# sudo mkdir $CHROMEDRIVER_DIR
# echo "Installing chromedriver version"
# wget --no-verbose -O /tmp/$CHROMEDRIVER_ARCHIVE $CHROMEDRIVER_URL
# sudo unzip -qq /tmp/$CHROMEDRIVER_ARCHIVE -d $CHROMEDRIVER_DIR
# sudo chmod +x $CHROMEDRIVER_BIN
# sudo ln -sf "$CHROMEDRIVER_BIN" /usr/bin/
# sudo echo "CHROMEWEBDRIVER=$CHROMEDRIVER_DIR" | sudo tee -a /etc/environment
- name: Before install
run: |
../orca/bin/ci/self-test/before_install.sh
../orca/bin/ci/before_install.sh
- name: Install
run: |
../orca/bin/ci/self-test/install.sh
../orca/bin/ci/install.sh
- name: Before script
run: ../orca/bin/ci/before_script.sh
- name: Script
run: |
../orca/bin/ci/self-test/script.sh
unset ORCA_ENABLE_NIGHTWATCH
../orca/bin/ci/script.sh
# These two jobs need to run regardless of success or failure in ORCA's self-tests in order to exercise the code.
- name: After script
run: |
../orca/bin/ci/self-test/after_success.sh
unset ORCA_COVERAGE_COBERTURA_ENABLE
unset ORCA_COVERAGE_CLOVER_ENABLE
unset ORCA_COVERAGE_ENABLE
../orca/bin/ci/after_success.sh
../orca/bin/ci/after_failure.sh
../orca/bin/ci/after_script.sh
# Require all checks to pass without having to enumerate them in the branch protection UI.
# @see https://github.saobby.my.eu.orgmunity/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957
all-successful:
if: always()
runs-on: ubuntu-latest
needs: [ build ]
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
- name: All checks successful
run: echo "🎉"