Skip to content

Commit 13c49bf

Browse files
authored
Merge pull request #156 from wmde/github-action-ci
Replace Travis CI with Github Actions
2 parents 457733e + 226540b commit 13c49bf

File tree

4 files changed

+52
-24
lines changed

4 files changed

+52
-24
lines changed

.github/workflows/ci.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Lint and Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
node-version: [10, 12, 14]
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
21+
- name: Setup Chrome
22+
uses: browser-actions/setup-chrome@latest
23+
with:
24+
chrome-version: stable
25+
26+
- name: Configure Chrome Sandbox
27+
run: |
28+
sudo chown root:root /opt/hostedtoolcache/setup-chrome/chromium/stable/x64/chrome-sandbox
29+
sudo chmod 4755 /opt/hostedtoolcache/setup-chrome/chromium/stable/x64/chrome-sandbox
30+
31+
- name: Install dependencies
32+
run: npm install
33+
34+
- name: Run ESLint and tests
35+
run: npm test
36+
env:
37+
CHROME_BIN: chrome
38+
CHROME_FLAGS: --no-sandbox --headless --disable-gpu

.travis.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

karma.conf.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ module.exports = function ( config ) {
3131
port: 9876,
3232

3333
logLevel: config.LOG_INFO,
34-
browsers: [ 'PhantomJS' ]
34+
browsers: [ 'ChromeHeadless' ],
35+
customLaunchers: {
36+
ChromeHeadless: {
37+
base: 'Chrome',
38+
flags: [
39+
'--no-sandbox',
40+
'--headless',
41+
'--disable-gpu',
42+
'--disable-dev-shm-usage',
43+
'--disable-software-rasterizer'
44+
]
45+
}
46+
}
3547
} );
3648
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"eslint-config-wikimedia": "0.4.0",
3838
"karma": "^6.1.0",
3939
"karma-cli": "^1.0.1",
40-
"karma-phantomjs-launcher": "^1.0.4",
40+
"karma-chrome-launcher": "^3.1.0",
4141
"karma-qunit": "^4.1.2",
4242
"qunit": "^2.14.0"
4343
},

0 commit comments

Comments
 (0)