diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9f96475b..726605b9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,12 +30,15 @@ jobs: - name: Install docker run: brew install colima docker docker-compose - + - name: Start colima run: colima start - - - name: Start local test server - run: docker-compose -p xmtp -f dev/local/docker-compose.yml up -d + + - name: Start Docker containers + run: dev/up + +# - name: Start local test server +# run: docker-compose -p xmtp -f dev/local/docker-compose.yml up -d # - name: Test with xcodebuild # run: xcodebuild test -scheme XMTP -destination "platform=iOS Simulator,name=iPhone 14" diff --git a/Package.resolved b/Package.resolved index 04f7aede..d2e8c1d2 100644 --- a/Package.resolved +++ b/Package.resolved @@ -41,8 +41,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/xmtp/libxmtp-swift", "state" : { - "revision" : "de859c86a5854bdc2cfd54e8f98b6088a38a2f3c", - "version" : "0.4.2-beta2" + "revision" : "28ee27a4ded8b996a74850e366247e9fe51d782a", + "version" : "0.4.2-beta4" } }, { diff --git a/dev/local/compose b/dev/local/compose new file mode 100755 index 00000000..3bf5bb4f --- /dev/null +++ b/dev/local/compose @@ -0,0 +1,4 @@ +#!/bin/bash +set -eou pipefail + +docker-compose -f dev/local/docker-compose.yml -p "xmtp-android" "$@" diff --git a/dev/local/docker-compose.yml b/dev/local/docker-compose.yml index 8eb6dd4c..9418154b 100644 --- a/dev/local/docker-compose.yml +++ b/dev/local/docker-compose.yml @@ -1,6 +1,5 @@ -version: "3.8" services: - wakunode: + node: image: xmtp/node-go:latest platform: linux/amd64 environment: @@ -9,28 +8,27 @@ 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 # http message API - - 5556:5556 # grpc message API + - 5555:5555 + - 5556:5556 depends_on: - db - healthcheck: - test: [ "CMD", "lsof", "-i", ":5556" ] - interval: 3s - timeout: 10s - retries: 5 + + validation: + image: ghcr.io/xmtp/mls-validation-service:main + platform: linux/amd64 + db: image: postgres:13 environment: POSTGRES_PASSWORD: xmtp - js: - restart: always - platform: linux/amd64 - depends_on: - wakunode: - condition: service_healthy - build: ./../test - \ No newline at end of file + + mlsdb: + image: postgres:13 + environment: + POSTGRES_PASSWORD: xmtp diff --git a/dev/test/Dockerfile b/dev/local/test/Dockerfile similarity index 80% rename from dev/test/Dockerfile rename to dev/local/test/Dockerfile index 1a6d30a6..27716fe2 100644 --- a/dev/test/Dockerfile +++ b/dev/local/test/Dockerfile @@ -2,5 +2,6 @@ FROM node:19-alpine WORKDIR /code ADD script.js script.js +RUN apk update && apk add git RUN npm install @xmtp/xmtp-js ethers CMD ["node", "script.js"] diff --git a/dev/test/script.js b/dev/local/test/script.js similarity index 95% rename from dev/test/script.js rename to dev/local/test/script.js index 8dd5c1c1..164a446c 100644 --- a/dev/test/script.js +++ b/dev/local/test/script.js @@ -32,4 +32,4 @@ async function checkAll() { } } -checkAll().then(() => console.log("Done")); +checkAll().then(() => console.log("Done")); \ No newline at end of file diff --git a/dev/local/up b/dev/local/up new file mode 100755 index 00000000..633f0db7 --- /dev/null +++ b/dev/local/up @@ -0,0 +1,6 @@ +#!/bin/bash +set -eou pipefail +script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" + +"${script_dir}"/compose pull +"${script_dir}"/compose up -d --build \ No newline at end of file diff --git a/dev/up b/dev/up new file mode 100755 index 00000000..49ea0deb --- /dev/null +++ b/dev/up @@ -0,0 +1,18 @@ +#!/bin/bash +set -eou pipefail + +if [[ "${OSTYPE}" == "darwin"* ]]; then + if ! which buf &>/dev/null; then brew install buf; fi + if ! which shellcheck &>/dev/null; then brew install shellcheck; fi + if ! which markdownlint &>/dev/null; then brew install markdownlint-cli; fi + if ! java -version &>/dev/null; then + brew install java + sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk \ + /Library/Java/JavaVirtualMachines/ + fi + if ! kotlinc -version &>/dev/null; then brew install kotlin; fi +fi + +rustup update + +dev/local/up