Migrate our tests to use github actions (#4614)

This commit is contained in:
alschmiedt
2021-02-02 10:08:51 -08:00
committed by GitHub
parent 3bf364a759
commit 26beff4b2c
6 changed files with 54 additions and 39 deletions

View File

@@ -44,8 +44,8 @@ async function runGeneratorsInBrowser() {
},
path: '/wd/hub'
};
// Run in headless mode on Travis.
if (process.env.TRAVIS_CI) {
// Run in headless mode on Github Actions.
if (process.env.CI) {
options.capabilities['moz:firefoxOptions'] = {
args: ['-headless']
};

View File

@@ -24,8 +24,8 @@ async function runMochaTestsInBrowser() {
},
path: '/wd/hub'
};
// Run in headless mode on Travis.
if (process.env.TRAVIS_CI) {
// Run in headless mode on Github Actions.
if (process.env.CI) {
options.capabilities['goog:chromeOptions'] = {
args: ['--headless', '--no-sandbox', '--disable-dev-shm-usage']
};

View File

@@ -1,18 +1,17 @@
#!/bin/bash
if [ ! -z $TRAVIS ]; then echo "Executing run_all_tests.sh from $(pwd)"; fi
if [ ! -z $CI ]; then echo "Executing run_all_tests.sh from $(pwd)"; fi
# ANSI colors
BOLD_GREEN='\033[1;32m'
BOLD_RED='\033[1;31m'
ANSI_RESET='\033[0m'
travis_fold () {
gh_actions_fold () {
local startOrEnd=$1 # Either "start" or "end"
local id=$2 # The fold id. No spaces.
if [ ! -z $TRAVIS ]; then
echo "travis_fold:$startOrEnd:$id"
if [ ! -z $CI ]; then
echo "::$startOrEnd::"
fi
}
@@ -37,10 +36,10 @@ run_test_command () {
echo "======================================="
echo "== $test_id"
travis_fold start $test_id
gh_actions_fold group
$command
local test_result=$?
travis_fold end $test_id
gh_actions_fold endgroup
if [ $test_result -eq 0 ]; then
echo -e "${BOLD_GREEN}SUCCESS:${ANSI_RESET} ${test_id}"
else

View File

@@ -1,8 +1,8 @@
#!/bin/bash
if [ "${TRAVIS_OS_NAME}" == "linux" ]
if [ "${RUNNER_OS}" == "Linux" ]
then
export CHROME_BIN="/usr/bin/google-chrome"
sh -e /etc/init.d/xvfb start &
Xvfb :99 &
export DISPLAY=:99 &
npm run test:prepare > /dev/null &
fi