forked from rrweb-io/rrweb
-
Notifications
You must be signed in to change notification settings - Fork 6
81 lines (66 loc) · 2.08 KB
/
ci-cd.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Build & Tests
on:
push:
branches:
- master
- release/**
pull_request:
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
job_test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- name: Setup Node.js lts/*
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'yarn'
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Build Project
run: NODE_OPTIONS='--max-old-space-size=4096' yarn build:all
- name: Check types
run: yarn turbo run check-types
- name: Run tests
run: PUPPETEER_HEADLESS=true xvfb-run --server-args="-screen 0 1920x1080x24" yarn test
- name: Upload diff images to GitHub
uses: actions/upload-artifact@v3
if: failure()
with:
name: image-diff
path: packages/rrweb/test/*/__image_snapshots__/__diff_output__/*.png
if-no-files-found: ignore
job_artifacts:
needs: job_test
name: Upload Artifacts
runs-on: ubuntu-latest
# Build artifacts are only needed for releasing workflow.
if: startsWith(github.ref, 'refs/heads/release/')
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node.js lts/*
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'yarn'
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Build Project
run: NODE_OPTIONS='--max-old-space-size=4096' yarn build:all
- name: Build Tarballs
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: yarn build:tarball
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ github.sha }}
path: |
${{ github.workspace }}/packages/**/*.tgz