-
Notifications
You must be signed in to change notification settings - Fork 576
67 lines (57 loc) · 1.68 KB
/
package-unit-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Unit tests
env:
REALM_DISABLE_ANALYTICS: 1
MOCHA_REMOTE_TIMEOUT: 10000
BAAS_BRANCH: master
on:
pull_request:
paths:
# Source code
- "packages/**"
# No need to run when updating documentation
- "!**.md"
# Run this on updates to the workflow
- ".github/workflows/package-unit-tests.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit-tests-linux:
strategy:
fail-fast: false
matrix:
workspace:
- realm
- '@realm/babel-plugin'
- '@realm/react'
include:
- workspace: '@realm/react'
use-baas: true
name: ${{ matrix.workspace }} unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-node@v4
with:
node-version: 20
# ninja-build is used by default if available and results in faster build times
- name: Install ninja
run: sudo apt-get install ninja-build
- name: ccache
uses: hendrikmuhs/ccache-action@v1
# Install the root package to get dev-dependencies
# (--ignore-scripts to avoid downloading or building the native module)
- run: npm ci --ignore-scripts
- name: Start BaaS test server
id: baas
if: ${{matrix.use-baas}}
uses: ./.github/actions/baas-test-server
with:
branch: ${{ env.BAAS_BRANCH }}
env:
BAASAAS_KEY: ${{ secrets.BAASAAS_KEY }}
- run: npm test --workspace ${{ matrix.workspace }}
env:
REALM_BASE_URL: ${{ steps.baas.outputs.baas-url }}