diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..2df8959 --- /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: ['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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7cf06d0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: node_js - -node_js: -- 8 -- 12 -- node - -sudo: false - -before_script: - - npm install - -script: - - npm run test - -deploy: - provider: npm - email: engineering-managers@wikimedia.de - api_key: - secure: hZ/nMTcsDSbW8L6xln8rw1AvFrQM75h+wQ/Z05OhDjOPG5xdFkp+UOSFkkSzs+6bC6R//BnuKT8rRe7zuBhZuwU+lqpnwKgSDcKrdYG4uSM5qAK/T80EA6imue1vgPyh63E3gxcp4HRHBSNCe1IsyoJGBIV/gV+njCItTvi/fdQ= - on: - tags: true - branch: master - condition: "$TRAVIS_NODE_VERSION = 12" - -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 a94e372..1991816 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -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' + ] + } + } } ); }; diff --git a/package.json b/package.json index 315ef3e..6a50dd1 100644 --- a/package.json +++ b/package.json @@ -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",