-
Notifications
You must be signed in to change notification settings - Fork 135
55 lines (52 loc) · 1.72 KB
/
ci.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
# 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: CI
on:
push:
branches: [main]
pull_request: {}
jobs:
build:
strategy:
matrix:
node-version: [18, 19, 20]
system:
- os: ubuntu-22.04
runs-on: ${{ matrix.system.os }}
services:
postgres:
image: postgres:13
env:
POSTGRES_DB: indexer_tests
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpass
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: update OS
run: |
sudo apt-get update
sudo apt install -y --no-install-recommends gcc g++ make build-essential
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- run: yarn install --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
- run: yarn test:ci
env:
POSTGRES_TEST_HOST: localhost
POSTGRES_TEST_DATABASE: indexer_tests
POSTGRES_TEST_USERNAME: testuser
POSTGRES_TEST_PASSWORD: testpass
NODE_OPTIONS: "--dns-result-order=ipv4first"
INDEXER_TEST_JRPC_PROVIDER_URL: ${{ secrets.TESTS_RPC_PROVIDER }}