Skip to content

Commit

Permalink
Revert "reformating"
Browse files Browse the repository at this point in the history
This reverts commit 2a20b51.
  • Loading branch information
sayan goswami committed Aug 11, 2023
1 parent 2a20b51 commit 27347d7
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 9 deletions.
50 changes: 46 additions & 4 deletions .github/workflows/orca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,23 @@ jobs:
build:
runs-on: ubuntu-latest
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.community/t/how-to-use-env-context/16975/9
ORCA_SUT_DIR: /home/runner/work/orca/example
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_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:
Expand Down Expand Up @@ -60,49 +65,86 @@ jobs:
orca-enable-nightwatch: [ "FALSE" ]
orca-coverage-enable: [ "FALSE" ]
include:
# Testing Drupal 10 in php 8.1 with nightwatch and coverage.
- orca-job: ISOLATED_TEST_ON_CURRENT
php-version: "8.1"
orca-enable-nightwatch: "TRUE"
orca-coverage-enable: "TRUE"

# # Testing Drupal 10 in php 8.2.
# - orca-job: ISOLATED_TEST_ON_CURRENT
# php-version: "8.2"
#
# # Testing latest Drupal 9 in php 8.2.
# - orca-job: INTEGRATED_TEST_ON_LATEST_LTS
# php-version: "8.2"


steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 20.x

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug

- name: Install google-chrome-stable
run: |
npx @puppeteer/browsers install chrome@114
echo $CHROME_VERSION
# Download driver
npx @puppeteer/browsers install chromedriver@114
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_114.0.5735.198-1_amd64.deb \
&& sudo apt install -y /tmp/chrome.deb \
&& sudo rm /tmp/chrome.deb
cd /tmp/
sudo dpkg -i chrome.deb
update-alternatives --list google-chrome
update-alternatives --display google-chrome
CHROME_VERSION="$(google-chrome-stable --version)"
echo $CHROME_VERSION
CHROME_VERSION2="$(google-chrome --version)"
echo $CHROME_VERSION2
which chromedriver
CHROME_DRIVER_VERSION_STRING="114.0.5735.90"
wget -N https://chromedriver.storage.googleapis.com/${CHROME_DRIVER_VERSION_STRING}/chromedriver_linux64.zip -P ~/
unzip ~/chromedriver_linux64.zip -d ~/
rm ~/chromedriver_linux64.zip
sudo mv -f ~/chromedriver /usr/local/share/
sudo chmod +x /usr/local/share/chromedriver
ln -sf /usr/local/share/chromedriver /usr/local/bin/chromedriver
- 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_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.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957
all-successful:
if: always()
runs-on: ubuntu-latest
Expand Down
6 changes: 1 addition & 5 deletions bin/ci/self-test/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,8 @@ if [[ "$ORCA_ENABLE_NIGHTWATCH" == "TRUE" && "$ORCA_SUT_HAS_NIGHTWATCH_TESTS" &&
orca fixture:run-server &
SERVER_PID=$!

/usr/local/share/chromium/chrome-linux/chrome --headless --no-sandbox &
CHROME_PID=$!

# @todo could we set DRUPAL_TEST_CHROMEDRIVER_AUTOSTART instead of launching Chromedriver manually?
chromedriver --no-sandbox --disable-dev-shm-usage --disable-extensions --disable-gpu --headless --port=4444 &
/usr/local/share/chromedriver --headless --no-sandbox --disable-dev-shm-usage --disable-extensions --disable-gpu --port=4444 &
CHROMEDRIVER_PID=$!

eval "yarn test:nightwatch \\
Expand All @@ -69,6 +66,5 @@ if [[ "$ORCA_ENABLE_NIGHTWATCH" == "TRUE" && "$ORCA_SUT_HAS_NIGHTWATCH_TESTS" &&

kill -0 $SERVER_PID
kill -0 $CHROMEDRIVER_PID
kill -0 $CHROME_PID
)
fi

0 comments on commit 27347d7

Please sign in to comment.