diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..f695c26 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4450a80..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: node_js - -node_js: -- 10 -- 12 -- 14 - -before_script: - - npm install - -script: - - npm test - -notifications: - irc: - channels: - - "irc.libera.chat#wikidata-feed" - on_success: change - on_failure: always - template: - - "%{repository}/%{branch}/%{commit} : %{author} %{message} %{build_url}" - diff --git a/karma.conf.js b/karma.conf.js index d471843..855c030 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -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' + ] + } + } } ); }; diff --git a/package.json b/package.json index f5c88b0..63d3ec1 100644 --- a/package.json +++ b/package.json @@ -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" },