-
Notifications
You must be signed in to change notification settings - Fork 4
101 lines (98 loc) · 3.5 KB
/
ci.yaml
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
---
name: Continuous Integration
on:
pull_request:
branches:
- '*'
push:
branches:
- master
jobs:
lint-and-unit-test:
timeout-minutes: 60
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v4
with:
key: cache-node-modules-${{ hashFiles('package-lock.json') }}
path: |
node_modules
packages/*/node_modules
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci --no-audit
- name: Install linux x64 specific package
run: npm i @nomicfoundation/solidity-analyzer-linux-x64-gnu solidity-comments-linux-x64-gnu
- name: Build and lint
run: npm run build && npm run lint
- name: Unit tests
run: npm run test
fastchain-docker-image:
timeout-minutes: 20
runs-on: ubuntu-20.04
needs:
- lint-and-unit-test
steps:
- uses: actions/[email protected]
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v4
with:
key: cache-node-modules-${{ hashFiles('package-lock.json') }}
path: |
node_modules
packages/*/node_modules
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci --no-audit
- name: Install linux x64 specific package
run: npm i @nomicfoundation/solidity-analyzer-linux-x64-gnu solidity-comments-linux-x64-gnu
- name: Build all packages
run: npm run build
- name: Build fastchain image
run: npm run docker:buildLocalArch -w packages/dev-chain-fast
- name: Build subgraph image
run: npm run docker:buildLocalArch -w packages/network-subgraphs
- name: Start docker stack
uses: streamr-dev/[email protected]
with:
services-to-start: 'deploy-network-subgraphs-fastchain graph-deploy-dataunion-subgraph-fastchain'
# services-to-start: 'ens-sync-script-fastchain deploy-network-subgraphs-fastchain graph-deploy-dataunion-subgraph-fastchain'
- name: Integration Test (with locally built images)
env:
TEST_TIMEOUT: '600000'
DEBUG: "*,-mocha:*"
run: npm run integration-test
# - name: Build & Push
# uses: docker/[email protected]
# with:
# context: .
# file: ./packages/dev-chain-fast/Dockerfile
# platforms: linux/amd64
# push: true
# load: false
# build-args: |
# NODE_ENV=production
# tags: streamr/broker-node:dev
# labels: |
# org.opencontainers.image.source=
# uses: ./.github/workflows/docker-build.yml
# with:
# docker_file: ./packages/dev-chain-fast/Dockerfile
# image_name: streamr/broker-node
# test_services_to_start: cassandra init-keyspace dev-chain-fast deploy-network-subgraphs-fastchain broker-node-storage-1
# build_platforms: linux/amd64
# test_script: bash ./.github/healthcheck.sh http://localhost:8891/info streamr-dev-broker-node-storage-1