-
Notifications
You must be signed in to change notification settings - Fork 134
100 lines (89 loc) · 2.46 KB
/
test-install-nitro-node.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
name: CI / nitro-node / e2e-test
on:
schedule:
- cron: "0 20 * * *" # At 0:20 UTC, which is 7:20 AM UTC+7
push:
branches:
- main
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
paths:
- ".github/scripts/e2e-test-install-nitro-node.js"
- ".github/workflows/test-install-nitro-node.yml"
- "nitro-node/**"
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/scripts/e2e-test-install-nitro-node.js"
- ".github/workflows/test-install-nitro-node.yml"
- "nitro-node/**"
workflow_dispatch:
jobs:
linux-pack-tarball:
runs-on: ubuntu-latest
outputs:
tarball-url: ${{ steps.upload.outputs.artifact-url }}
steps:
- name: Clone
id: checkout
uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Build tarball
id: build
run: |
cd nitro-node
make pack
find . -type f -name 'janhq-nitro-node-*.tgz' -exec mv {} janhq-nitro-node.tgz \;
- name: Upload tarball as artifact
id: upload
uses: actions/upload-artifact@master
with:
name: janhq-nitro-node
path: nitro-node/janhq-nitro-node.tgz
if-no-files-found: error
install:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
needs: [linux-pack-tarball]
if: always() && needs.linux-pack-tarball.result == 'success'
steps:
- name: Clone
id: checkout
uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Enable yarn
run: |
corepack enable
corepack prepare yarn@1 --activate
- name: Download prebuilt tarball
uses: actions/download-artifact@master
with:
name: janhq-nitro-node
path: .github/scripts/
- name: List tarball content
id: tar-tf
run: |
cd .github
cd scripts
tar tf janhq-nitro-node.tgz
- name: Run tests
id: test_install_nitro_node
env:
NITRO_NODE_PKG: ${{ github.workspace }}/.github/scripts/janhq-nitro-node.tgz
run: |
cd .github
cd scripts
cd nitro-node
node e2e-test-install-nitro-node.js