-
Notifications
You must be signed in to change notification settings - Fork 4
80 lines (70 loc) · 2.04 KB
/
nodejs.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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
jobs:
build:
runs-on: ${{ matrix.os }}
services:
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
# https://github.com/mosn/layotto/blob/main/docker/layotto-etcd/docker-compose.yml
etcd:
image: bitnami/etcd
env:
ALLOW_NONE_AUTHENTICATION: yes
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
ports:
- 2379:2379
- 2380:2380
strategy:
fail-fast: false
matrix:
node-version: [14, 16, 18, 20, 22]
os: [ubuntu-latest]
steps:
- name: Checkout Git Source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Bootstrap layotto
# run: |
# cd demo
# wget -q https://github.com/mosn/layotto/releases/download/v0.4.0/layotto.linux_amd64.zip
# unzip layotto.linux_amd64.zip
# chmod +x layotto
# ./layotto start -c ./config.json &
run: |
node demo/rpc/http/server.js &
cd layotto/cmd/layotto
time go build
./layotto start -c ../../../demo/config.json &
sleep 5
- name: Install Dependencies
run: npm i
- name: Continuous Integration
run: npm run ci
- name: Code Coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}