mirror of
https://github.com/owncast/owncast.git
synced 2024-11-21 20:28:15 +03:00
fix(test): run javascript tests as a part of build CI job
This commit is contained in:
parent
6c9e4704cc
commit
59f200c960
2 changed files with 4 additions and 52 deletions
|
@ -130,6 +130,10 @@ jobs:
|
||||||
- name: Check for unused JS code and dependencies
|
- name: Check for unused JS code and dependencies
|
||||||
run: npx knip --include dependencies,files,exports
|
run: npx knip --include dependencies,files,exports
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
working-directory: ./web
|
||||||
|
run: npm test
|
||||||
|
|
||||||
# After any formatting and linting is complete we can run the build
|
# After any formatting and linting is complete we can run the build
|
||||||
# and bundle step. This both will verify that the build is successful as
|
# and bundle step. This both will verify that the build is successful as
|
||||||
# well as commiting the updated static files into the repository for use.
|
# well as commiting the updated static files into the repository for use.
|
52
.github/workflows/javascript-tests.yml
vendored
52
.github/workflows/javascript-tests.yml
vendored
|
@ -1,52 +0,0 @@
|
||||||
name: Javascript Tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- 'web/**'
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'web/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
jest-run:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- id: skip_check
|
|
||||||
uses: fkirc/skip-duplicate-actions@v5
|
|
||||||
with:
|
|
||||||
concurrent_skipping: 'same_content_newer'
|
|
||||||
|
|
||||||
- name: Check out pull request code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
with:
|
|
||||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
||||||
|
|
||||||
- name: Check out repository code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
if: github.event_name == 'push'
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 18.9.0
|
|
||||||
|
|
||||||
- name: Cache node modules
|
|
||||||
uses: actions/cache@v4
|
|
||||||
env:
|
|
||||||
cache-name: cache-node-modules-javascript-tests
|
|
||||||
with:
|
|
||||||
path: ~/.npm
|
|
||||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('web/package-lock.json') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
||||||
${{ runner.os }}-build-
|
|
||||||
${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
|
||||||
working-directory: ./web
|
|
||||||
run: npm install
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
working-directory: ./web
|
|
||||||
run: npm test
|
|
Loading…
Reference in a new issue