This repository was archived by the owner on Aug 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
150 lines (127 loc) · 3.86 KB
/
guardoni_pull_request.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Guardoni - Pull Request
on:
pull_request:
branches:
- master
- daily
- beta
- feat/**
- fix/**
- refactor/**
paths:
- 'packages/shared/**'
- 'platforms/**'
jobs:
pull_request:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
services:
mongo-db:
image: mongo:4.2
ports:
- 27017:27017
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: yarn.lock
- name: Install modules
run: yarn
- name: Get version
id: version
run: |
echo "::set-output name=version::$(npm pkg get version | sed 's/"//g')"
- name: Lint code
run: yarn guardoni lint
- name: Build shared
run: yarn shared build
- name: Build guardoni
run: yarn guardoni tsc -b
- name: Start PM2
run: |
yarn clean
yarn pm2 start --env test ./platforms/ecosystem.config.js
- name: Test
run: |
yarn yt:ext build:guardoni
yarn tk:ext build:guardoni
yarn test guardoni --ci
yarn pm2 stop all
guardoni_build:
name: Guardoni build
runs-on: ${{ matrix.config.os }}
strategy:
max-parallel: 1
matrix:
node-version: [16.x]
config:
- os: ubuntu-latest
command: 'dist:linux'
# - os: macos-latest
# command: 'dist:mac'
# - os: windows-latest
# command: 'dist:windows'
services:
mongo-db:
image: mongo:4.2
ports:
- 27017:27017
steps:
# configure docker when os is macos
- uses: docker-practice/actions-setup-docker@master
if: ${{ matrix.config.os == 'macos-latest' }}
- name: 'Use GNU tar instead BSD tar'
if: matrix.config.os == 'windows-latest'
shell: cmd
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
- name: Checkout
uses: actions/checkout@v2
with:
fetch: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: yarn.lock
- uses: actions/cache@v2
with:
key: build-guardoni-${{ github.run_id }}-${{ matrix.config.os }}
restore-keys: |
build-guardoni-${{ github.run_id }}-macos-latest
build-guardoni-${{ github.run_id }}-ubuntu-latest
build-workspace-${{ github.run_id }}
path: |
packages/shared/build
packages/taboule/build
platforms/yttrex/extension/dist
platforms/tktrex/extension/dist
platforms/guardoni/build
platforms/guardoni/dist
platforms/ycai/studio/build
- name: Install Xvfb
run: |
sudo apt install -y xvfb x11-utils libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 xdotool
- name: Install dependencies
run: yarn
- name: Start PM2
run: yarn pm2 start --env test ./platforms/ecosystem.config.js
- name: Build Guardoni for ${{ matrix.config.os }}
working-directory: ./platforms/guardoni
run: ./scripts/cli-build.mjs
- name: Test CLI - YT Home
working-directory: ./platforms/guardoni
env:
DISPLAY: ':99.0'
run: xvfb-run --auto-servernum ./scripts/cli-yt-test-home.mjs
- name: Test CLI - YT Videos
run: yarn guardoni cli-yt-test-videos
- name: Stop PM2
run: yarn pm2 stop all