summaryrefslogtreecommitdiff
path: root/javascript/videojs/.github/workflows/ci.yml
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/videojs/.github/workflows/ci.yml')
-rw-r--r--javascript/videojs/.github/workflows/ci.yml72
1 files changed, 72 insertions, 0 deletions
diff --git a/javascript/videojs/.github/workflows/ci.yml b/javascript/videojs/.github/workflows/ci.yml
new file mode 100644
index 0000000..c61b30e
--- /dev/null
+++ b/javascript/videojs/.github/workflows/ci.yml
@@ -0,0 +1,72 @@
+name: ci
+
+on: [push, pull_request]
+
+jobs:
+ should-skip:
+ continue-on-error: true
+ runs-on: ubuntu-latest
+ # Map a step output to a job output
+ outputs:
+ should-skip-job: ${{steps.skip-check.outputs.should_skip}}
+ steps:
+ - id: skip-check
+ uses: fkirc/skip-duplicate-actions@v5.3.1
+ with:
+ github_token: ${{github.token}}
+
+ ci:
+ needs: should-skip
+ if: ${{needs.should-skip.outputs.should-skip-job != 'true' || github.ref == 'refs/heads/main'}}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest]
+ test-type: [unit, coverage]
+ env:
+ BROWSER_STACK_USERNAME: ${{secrets.BROWSER_STACK_USERNAME}}
+ BROWSER_STACK_ACCESS_KEY: ${{secrets.BROWSER_STACK_ACCESS_KEY}}
+ CI_TEST_TYPE: ${{matrix.test-type}}
+ runs-on: ${{matrix.os}}
+ steps:
+ - name: checkout code
+ uses: actions/checkout@v4
+
+ - name: read node version from .nvmrc
+ run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
+ shell: bash
+ id: nvm
+
+ - name: update apt cache on linux w/o browserstack
+ run: sudo apt-get update
+
+ - name: install ffmpeg/pulseaudio for firefox on linux w/o browserstack
+ run: sudo apt-get install ffmpeg pulseaudio
+
+ - name: start pulseaudio for firefox on linux w/o browserstack
+ run: pulseaudio -D
+
+ - name: setup node
+ uses: actions/setup-node@v4
+ with:
+ node-version: '${{steps.nvm.outputs.NVMRC}}'
+ cache: npm
+
+ # turn off the default setup-node problem watchers...
+ - run: echo "::remove-matcher owner=eslint-compact::"
+ - run: echo "::remove-matcher owner=eslint-stylish::"
+ - run: echo "::remove-matcher owner=tsc::"
+
+ - name: npm install
+ run: npm i --prefer-offline --no-audit
+
+ - name: run npm test
+ run: npm run test
+
+ - name: coverage
+ uses: codecov/codecov-action@v4
+ with:
+ token: ${{secrets.CODECOV_TOKEN}}
+ files: './test/dist/coverage/coverage-final.json'
+ fail_ci_if_error: true
+ if: ${{startsWith(env.CI_TEST_TYPE, 'coverage')}}