-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (79 loc) · 2.12 KB
/
build.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
name: Build
on:
pull_request:
branches:
- main
jobs:
verify:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v3
- name: Verify README generation
uses: momentohq/standards-and-practices/github-actions/oss-readme-template@gh-actions-v2
with:
project_status: official
project_stability: alpha
project_type: other
test-momento:
strategy:
matrix:
node: [16, 18, 20]
compression: [true, false]
name: Test on Node ${{ matrix.node }}
runs-on: macos-latest
env:
MOMENTO_API_KEY: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
CACHE_NAME: js-io-redis-client-test-ci
COMPRESSION: ${{ matrix.compression }}
steps:
- name: Setup repo
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: npm
- name: Install dependencies
run: |
npm ci
node -v
- name: Build
run: npm run build
- name: Lint
run: npm run lint
- name: Test using a Momento backend
run: npm run test-momento
# This is a separate job from than the above because the container services
# do not run off the shelf on macos. This is a known issue with GitHub Actions.
test-redis:
strategy:
# TODO the redis tests are flaky when run all in parallel.
max-parallel: 2
matrix:
node: [16, 18, 20]
name: Test on Node ${{ matrix.node }}
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- name: Setup repo
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: npm
- name: Install dependencies
run: |
npm ci
node -v
- name: Build
run: npm run build
- name: Lint
run: npm run lint
- name: Test using a Redis backend
run: npm run test-redis