mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Migrate our tests to use github actions (#4614)
This commit is contained in:
@@ -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']
|
||||
};
|
||||
|
||||
@@ -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']
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user