Skip to content

Commit

Permalink
Merge pull request #664 from xmtp/rygine/update-ci
Browse files Browse the repository at this point in the history
Enable MLS in Docker container, run MLS client tests in CI
  • Loading branch information
rygine authored Sep 17, 2024
2 parents c2b08e4 + afdfedd commit 003d770
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 22 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/js-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ jobs:
test:
name: Test
# TODO: Investigate why fetch is failing for some of these tests on warp build runners
runs-on: ubuntu-latest
runs-on: warp-ubuntu-latest-x64-8x
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -95,8 +94,12 @@ jobs:
run: corepack enable
- name: Install dependencies
run: yarn
- run: ./dev/up
- run: |
- name: Start dev environment
run: ./dev/up
- name: Sleep for 5 seconds
run: sleep 5s
- name: Run node tests
run: |
cd packages/js-sdk
yarn test:node
env:
Expand All @@ -105,7 +108,8 @@ jobs:
DD_SERVICE: xmtp-js
DD_CIVISIBILITY_AGENTLESS_ENABLED: 'true'
DD_API_KEY: ${{ secrets.DD_API_KEY }}
- run: |
- name: Run browser tests
run: |
cd packages/js-sdk
yarn test:browser
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/mls-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,27 @@ jobs:
test:
name: Test
runs-on: ubuntu-latest
runs-on: warp-ubuntu-latest-x64-8x
steps:
- run: echo "No tests for MLS Client yet."
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
env:
SKIP_YARN_COREPACK_CHECK: '1'
- name: Enable corepack
run: corepack enable
- name: Install dependencies
run: yarn
- name: Start dev environment
run: ./dev/up
- name: Sleep for 5 seconds
run: sleep 5s
- name: Run tests
run: |
cd packages/mls-client
yarn test
build:
name: Build
Expand Down
4 changes: 4 additions & 0 deletions dev/compose
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -eou pipefail

docker compose -f dev/docker-compose.yml -p "xmtp-js" "$@"
4 changes: 0 additions & 4 deletions dev/docker-compose

This file was deleted.

19 changes: 17 additions & 2 deletions dev/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
services:
waku-node:
node:
image: xmtp/node-go:latest
platform: linux/amd64
environment:
Expand All @@ -8,14 +8,29 @@ services:
- --store.enable
- --store.db-connection-string=postgres://postgres:xmtp@db:5432/postgres?sslmode=disable
- --store.reader-db-connection-string=postgres://postgres:xmtp@db:5432/postgres?sslmode=disable
- --mls-store.db-connection-string=postgres://postgres:xmtp@mlsdb:5432/postgres?sslmode=disable
- --mls-validation.grpc-address=validation:50051
- --api.enable-mls
- --wait-for-db=30s
- --api.authn.enable
ports:
- 9001:9001
- 5555:5555
- 5556:5556
depends_on:
- db
- mlsdb
- validation

validation:
image: ghcr.io/xmtp/mls-validation-service:main
platform: linux/amd64

db:
image: postgres:13
environment:
POSTGRES_PASSWORD: xmtp

mlsdb:
image: postgres:13
environment:
POSTGRES_PASSWORD: xmtp
5 changes: 3 additions & 2 deletions dev/down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e
set -eou pipefail
script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

dev/docker-compose down
"${script_dir}"/compose down
11 changes: 4 additions & 7 deletions dev/up
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/bin/bash
set -e
set -eou pipefail
script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

if ! which docker &>/dev/null; then
echo "Docker required to run dev/up. Install it and run this again."
exit 1
fi

dev/docker-compose up -d
"${script_dir}"/compose pull
"${script_dir}"/compose up -d --wait

0 comments on commit 003d770

Please sign in to comment.