ci: migrate to GitHub Actions from CircleCI, allow running Browserstack on forked repo via label (#2417)

* Remove CircleCI and codecov

* Add GitHub Actions workflow

* Add Browserstack credentials

* Skip tests if ci skip or skip ci is in commit messages

* Update and rename test.yml to ci.yml

* Postfix artifacts name with browser

* Disable proxy on chrome

* Update dockers/screenshotter/screenshotter.js

* Add status badge

* Set directory option in codecov action

* Run Browserstack on forked repo via label

* Print Docker logs

* Disable GPU on ChromeDriver

* Add comments

* Add comments
This commit is contained in:
ylemkimon
2020-08-18 04:58:08 +09:00
committed by GitHub
parent b59ca67530
commit 221042be86
6 changed files with 191 additions and 264 deletions

View File

@@ -10,6 +10,7 @@ const pako = require("pako");
const path = require("path");
const selenium = require("selenium-webdriver");
const firefox = require("selenium-webdriver/firefox");
const chrome = require("selenium-webdriver/chrome");
const istanbulLibCoverage = require('istanbul-lib-coverage');
const istanbulLibReport = require('istanbul-lib-report');
@@ -152,8 +153,12 @@ function guessDockerIPs() {
return;
}
// Native Docker on Linux or remote Docker daemon or similar
const gatewayIP = cmd("docker", "inspect",
"-f", "{{.NetworkSettings.Gateway}}", opts.container);
// https://docs.docker.com/engine/tutorials/networkingcontainers/
const gatewayIP = cmd("docker", "inspect", // using default bridge network
"-f", "{{.NetworkSettings.Gateway}}", opts.container)
|| cmd("docker", "inspect", // using own network
"-f", "{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}",
opts.container);
seleniumIP = seleniumIP || gatewayIP;
katexIP = katexIP || gatewayIP;
}
@@ -277,6 +282,10 @@ function buildDriver() {
ffProfile.setPreference("browser.startup.page", 0);
const ffOptions = new firefox.Options().setProfile(ffProfile);
builder.setFirefoxOptions(ffOptions);
} else if (opts.browser === "chrome") {
// https://stackoverflow.com/questions/48450594/selenium-timed-out-receiving-message-from-renderer
const chrOptions = new chrome.Options().addArguments("--disable-gpu");
builder.setChromeOptions(chrOptions);
}
if (seleniumURL) {
builder.usingServer(seleniumURL);