From d997768ac7d2ffd8224a70c4b9ec1c0fa2b78fb7 Mon Sep 17 00:00:00 2001 From: Pierre-Etienne Poirot Date: Mon, 9 Oct 2023 23:53:19 +0200 Subject: [PATCH] Add a GitHub action --- .github/workflows/tests.yml | 18 ++++++++++++++++++ karma.conf.js | 7 +++++++ 2 files changed, 25 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..e524957 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,18 @@ +name: DASH Validator tests +on: [ push ] +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [ 'lts/*' ] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - uses: browser-actions/setup-chrome@v1 + id: setup-chrome + - run: export CHROME_BIN=${{ steps.setup-chrome.outputs.chrome-path }} + - run: npm install + - run: npm test diff --git a/karma.conf.js b/karma.conf.js index 86caf8b..1447175 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -40,6 +40,10 @@ module.exports = function (config) { Chrome_travis_ci: { base: 'Chrome', flags: ['--no-sandbox'] + }, + Chrome_github_ci: { + base: 'ChromeHeadless', + flags: ['--no-sandbox'] } }, coverageReporter: { @@ -54,5 +58,8 @@ module.exports = function (config) { if (process.env.TRAVIS) { configuration.browsers = ['Chrome_travis_ci']; } + if (process.env.GITHUB_ACTION) { + configuration.browsers = ['Chrome_github_ci']; + } config.set(configuration); };