-
Notifications
You must be signed in to change notification settings - Fork 292
98 lines (93 loc) · 3.17 KB
/
test.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: "[Test] Libraries"
on:
push:
branches:
- main
- develop
pull_request:
workflow_dispatch:
inputs:
since_branch:
description: The branch that turborepo will check when diffing.
default: "develop"
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-libraries:
name: "Test Libraries"
env:
NODE_OPTIONS: "--max-old-space-size=7168"
FORCE_COLOR: 3
CI_OS: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
# Commenting because of random node-gyp failures on windows…
# See:
# * https://github.com/serialport/node-serialport/issues/2322
# * https://github.com/serialport/node-serialport/issues/2322
# - windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2.1.0
with:
version: latest
- uses: actions/setup-node@v3
with:
node-version: 16
cache: pnpm
cache-dependency-path: "**/pnpm-lock.yaml"
- uses: actions/setup-python@v2
with:
python-version: "2.7.x"
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true
- name: Bump npm to latest
run: |
npm i -g npm@8.12.2
npm --version
- name: TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: "yolo"
- name: Install dependencies
run: pnpm i --filter="!./apps/**"
- name: Build and Test affected libraries (Pull Request)
if: ${{ github.event_name != 'push' }}
run: pnpm run test --continue --filter="!./apps/**" --filter="!live-common-tools" --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.event.inputs.since_branch || 'develop' }}]" --api="http://127.0.0.1:9080" --token="yolo" --team="foo"
shell: bash
- name: Build and Test affected libraries (Pull Request)
if: ${{ github.event_name == 'push' }}
run: pnpm run test --continue --filter="!./apps/**" --filter="!live-common-tools" --filter=[HEAD^1] --api="http://127.0.0.1:9080" --token="yolo" --team="foo"
shell: bash
- name: (On Failure) Upload live-common snapshots and source
uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ format('live-common-src-{0}', matrix.os) }}
path: |
libs/ledger-live-common/src
- name: (On Failure) Upload react-ui test results
uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ format('react-ui-test-results-{0}', matrix.os) }}
path: |
libs/ui/tests/react.spec.js-snapshots/
libs/ui/test-results/
- name: Test coverage
if: always()
run: npx codecov -F test
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}