mirror of
https://github.com/google/blockly.git
synced 2026-01-08 09:30:06 +01:00
41
.github/workflows/build.yml
vendored
Normal file
41
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
# This workflow will do a clean install, start the selenium server, and run
|
||||
# all of our tests.
|
||||
|
||||
name: Node.js CI
|
||||
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
build:
|
||||
# TODO (#2114): re-enable osx build.
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [10.x, 12.x, 14.x]
|
||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Npm Install
|
||||
run: npm install
|
||||
|
||||
- name: Linux Test Setup
|
||||
if: runner.os == 'Linux'
|
||||
run: source ./tests/scripts/setup_linux_env.sh
|
||||
|
||||
- name: MacOS Test Setup
|
||||
if: runner.os == 'macOS'
|
||||
run: source ./tests/scripts/setup_osx_env.sh
|
||||
|
||||
- name: Run
|
||||
run: npm run test:run
|
||||
|
||||
env:
|
||||
CI: true
|
||||
25
.travis.yml
25
.travis.yml
@@ -1,25 +0,0 @@
|
||||
language: node_js
|
||||
os: linux
|
||||
dist: xenial
|
||||
node_js:
|
||||
- 10
|
||||
- 12
|
||||
- 14
|
||||
addons:
|
||||
chrome: stable
|
||||
firefox: latest
|
||||
# TODO (#2114): re-enable osx build.
|
||||
# - os: osx
|
||||
# node_js: stable
|
||||
# osx_image: xcode8.3
|
||||
# addons:
|
||||
# firefox: latest
|
||||
env:
|
||||
- TRAVIS_CI=true
|
||||
before_script:
|
||||
- export DISPLAY=:99.0
|
||||
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ( tests/scripts/setup_linux_env.sh ) fi
|
||||
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then ( tests/scripts/setup_osx_env.sh ) fi
|
||||
- sleep 2
|
||||
script:
|
||||
- npm run test:run
|
||||
@@ -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