Skip to content

feat: add integration tests to actions #44

feat: add integration tests to actions

feat: add integration tests to actions #44

Workflow file for this run

name: Integration Tests
on:
push:
branches:
- dev
- dev2
pull_request:
branches:
- dev
- dev2
jobs:
test:
runs-on: ubuntu-latest
services:
docker:
image: docker:19.03.12
options: --privileged
ports:
- 5432:5432
- 18443:18443
- 50001:50001
- 8000:8000
- 18080:18080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Compose
run: |
docker-compose -f docker-compose-test.yml up --build -d
- name: Wait for services to be ready
run: |
sleep 100 # Adjust time as necessary for services to initialize
- name: Verify Mercury Service with Curl
run: |
container_id=$(docker ps -qf "name=mercurylayer_mercury_1")
echo "Container ID: $container_id"
docker logs $container_id
docker exec $container_id curl http://0.0.0.0:8000/info/config
- name: Add Mnemonic
run: |
docker exec $(docker ps -qf "name=enclave") \
curl -X POST http://0.0.0.0:18080/add_mnemonic \
-H "Content-Type: application/json" \
-d '{
"mnemonic": "achieve merry hidden lyrics element brand student armed dismiss vague fury avocado grief crazy garlic gallery blur spider bag bless motor crawl surround copper",
"password": "b1gHKyfXTzs6",
"index": 0,
"threshold": 2
}'
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20.12.2'
- name: Install Node.js dependencies for client
run: |
cd clients/apps/nodejs
npm install
- name: Install Node.js dependencies for lib
run: |
cd clients/libs/nodejs
npm install
- name: Run npm link
run: |
cd clients/libs/nodejs
npm link --save
- name: Link mercurynodejslib
run: |
cd clients/apps/nodejs
npm link mercurynodejslib
- name: Run Client-Side Tests
run: |
cd clients/apps/nodejs
node test_basic_workflow2.js
- name: Tear Down
run: |
docker-compose down