Run rust-peer using docker-compose (#168)

* Add docker-compose

* Run rust-peer using docker compose
This commit is contained in:
Anatoly Laskaris 2022-09-01 15:37:57 +03:00 committed by GitHub
parent 9de5aaeb36
commit 2fbde339b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 53 additions and 33 deletions

12
.github/e2e/docker-compose.yml vendored Normal file
View File

@ -0,0 +1,12 @@
services:
fluence-1:
image: ${RUST_PEER_IMAGE}
ports:
- 1210:1210
- 4310:4310
command:
- -t=1210
- -w=4310
- --local
- -k=gKdiCSUr1TFGFEgu2t8Ch1XEUsrN5A2UfBLjSZvfci9SPR3NvZpACfcpPGC3eY4zma1pk7UvYv5zb1VjvPHwCjj
- --aqua-pool-size=2

View File

@ -1,44 +1,52 @@
name: Run tests
defaults:
run:
working-directory: .
on:
push:
push:
jobs:
build:
runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 17.x]
strategy:
matrix:
node-version: [16.x, 17.x]
steps:
- uses: actions/checkout@v2
env:
RUST_PEER_IMAGE: fluencelabs/fluence
- uses: pnpm/action-setup@v2.2.2
with:
version: 7
steps:
- uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- uses: pnpm/action-setup@v2.2.2
with:
version: 7
- name: Run container with Fluence node
run: |
docker pull fluencelabs/fluence
docker run -d --rm -e RUST_LOG="info" -p 1210:1210 -p 4310:4310 fluencelabs/fluence -t 1210 -w 4310 -k gKdiCSUr1TFGFEgu2t8Ch1XEUsrN5A2UfBLjSZvfci9SPR3NvZpACfcpPGC3eY4zma1pk7UvYv5zb1VjvPHwCjj --local --aqua-pool-size 2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install deps
run: pnpm i
- name: Run tests
run: |
pnpm -r build
pnpm -r test
env:
CI: true
- name: Setup docker-compose
uses: KengoTODA/actions-setup-docker-compose@v1.0.9
with:
version: 'v2.10.0'
- name: Pull image
run: docker pull ${RUST_PEER_IMAGE}
- name: Run rust-peer
uses: isbang/compose-action@v1.1.0
with:
compose-file: ".github/e2e/docker-compose.yml"
down-flags: "--volumes"
- name: Install deps
run: pnpm i
- name: Run tests
run: |
pnpm -r build
pnpm -r test
env:
CI: true