run jest (#4177)
* run jest * wip * wip * wip * wip * skip frontend * rename * force failure * fix forced error try layer caching for speed * test cache * revert forced failure * remove branch test
This commit is contained in:
parent
4999837d74
commit
1112ba75c9
77
.github/workflows/run-tests.yaml
vendored
Normal file
77
.github/workflows/run-tests.yaml
vendored
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
name: Run backend tests
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: build-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
paths:
|
||||||
|
- "server/**.js"
|
||||||
|
- "collector/**.js"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run-script:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: '18'
|
||||||
|
|
||||||
|
- name: Cache root dependencies
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
node_modules
|
||||||
|
~/.cache/yarn
|
||||||
|
key: ${{ runner.os }}-yarn-root-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-yarn-root-
|
||||||
|
|
||||||
|
- name: Cache server dependencies
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
server/node_modules
|
||||||
|
~/.cache/yarn
|
||||||
|
key: ${{ runner.os }}-yarn-server-${{ hashFiles('server/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-yarn-server-
|
||||||
|
|
||||||
|
- name: Cache collector dependencies
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
collector/node_modules
|
||||||
|
~/.cache/yarn
|
||||||
|
key: ${{ runner.os }}-yarn-collector-${{ hashFiles('collector/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-yarn-collector-
|
||||||
|
|
||||||
|
- name: Install root dependencies
|
||||||
|
if: steps.cache-root.outputs.cache-hit != 'true'
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Install server dependencies
|
||||||
|
if: steps.cache-server.outputs.cache-hit != 'true'
|
||||||
|
run: cd server && yarn install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Install collector dependencies
|
||||||
|
if: steps.cache-collector.outputs.cache-hit != 'true'
|
||||||
|
run: cd collector && yarn install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Setup environment and Prisma
|
||||||
|
run: yarn setup:envs && yarn prisma:setup
|
||||||
|
|
||||||
|
- name: Run test suites
|
||||||
|
run: yarn test
|
||||||
|
|
||||||
|
- name: Fail job on error
|
||||||
|
if: failure()
|
||||||
|
run: exit 1
|
||||||
Loading…
Reference in New Issue
Block a user