Skip to content

Commit

Permalink
Merge pull request #81 from wmde/github-action-ci
Browse files Browse the repository at this point in the history
Replace Travis CI with Github Actions #156
  • Loading branch information
manicki authored Jan 9, 2025
2 parents 643e1a2 + f8680ad commit 33ce8f5
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 35 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: ['20.x', '22.x', '23.x']

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
33 changes: 0 additions & 33 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 @@ -35,6 +35,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 @@ -38,7 +38,7 @@
"eslint-plugin-mediawiki": "^0.2.1",
"karma": "^1.7.1",
"karma-cli": "^1.0.1",
"karma-phantomjs-launcher": "^1.0.4",
"karma-chrome-launcher": "^3.1.0",
"karma-qunit": "^1.2.1",
"karma-webpack": "^4.0.2",
"qunit": "^1.0.0",
Expand Down

0 comments on commit 33ce8f5

Please sign in to comment.