Skip to content

Commit

Permalink
Merge pull request #156 from wmde/github-action-ci
Browse files Browse the repository at this point in the history
Replace Travis CI with Github Actions
  • Loading branch information
manicki authored Jan 8, 2025
2 parents 457733e + 226540b commit 13c49bf
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 24 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint and Test

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10, 12, 14]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Setup Chrome
uses: browser-actions/setup-chrome@latest
with:
chrome-version: stable

- name: Configure Chrome Sandbox
run: |
sudo chown root:root /opt/hostedtoolcache/setup-chrome/chromium/stable/x64/chrome-sandbox
sudo chmod 4755 /opt/hostedtoolcache/setup-chrome/chromium/stable/x64/chrome-sandbox
- name: Install dependencies
run: npm install

- name: Run ESLint and tests
run: npm test
env:
CHROME_BIN: chrome
CHROME_FLAGS: --no-sandbox --headless --disable-gpu
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

14 changes: 13 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ module.exports = function ( config ) {
port: 9876,

logLevel: config.LOG_INFO,
browsers: [ 'PhantomJS' ]
browsers: [ 'ChromeHeadless' ],
customLaunchers: {
ChromeHeadless: {
base: 'Chrome',
flags: [
'--no-sandbox',
'--headless',
'--disable-gpu',
'--disable-dev-shm-usage',
'--disable-software-rasterizer'
]
}
}
} );
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"eslint-config-wikimedia": "0.4.0",
"karma": "^6.1.0",
"karma-cli": "^1.0.1",
"karma-phantomjs-launcher": "^1.0.4",
"karma-chrome-launcher": "^3.1.0",
"karma-qunit": "^4.1.2",
"qunit": "^2.14.0"
},
Expand Down

0 comments on commit 13c49bf

Please sign in to comment.