Skip to content

Commit 75c57c9

Browse files
committed
try some update ci stuff
1 parent 53c9e26 commit 75c57c9

File tree

7 files changed

+66
-10
lines changed

7 files changed

+66
-10
lines changed

.github/workflows/test.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212
jobs:
1313
library-unit:
1414
name: Library (Unit Tests)
15-
runs-on: ubuntu-latest
15+
runs-on: warp-ubuntu-latest-x64-16x
1616
steps:
1717
- name: Checkout project sources
1818
uses: actions/checkout@v3
@@ -24,15 +24,13 @@ jobs:
2424
uses: gradle/gradle-build-action@v2
2525
- name: Validate Gradle Wrapper
2626
uses: gradle/wrapper-validation-action@v1
27-
- name: Start local test server
28-
run: docker-compose -p xmtp -f dev/local/docker-compose.yml up -d
27+
- name: Start Docker containers
28+
run: dev/up
2929
- name: Gradle Run Unit Tests
3030
run: ./gradlew library:testDebug
31-
- name: Stop local test server
32-
run: docker-compose -p xmtp -f dev/local/docker-compose.yml down
3331
library-integration:
3432
name: Library (Integration Tests)
35-
runs-on: macos-latest
33+
runs-on: warp-macos-latest-arm64-6x
3634
steps:
3735
- name: Checkout project sources
3836
uses: actions/checkout@v3
@@ -48,13 +46,11 @@ jobs:
4846
run: brew install docker docker-compose
4947
- name: Start Colima
5048
run: colima start
51-
- name: Start local test server
52-
run: docker-compose -p xmtp -f dev/local/docker-compose.yml up -d
49+
- name: Start Docker containers
50+
run: dev/up
5351
- name: Gradle Run Integration Tests
5452
uses: reactivecircus/android-emulator-runner@v2
5553
with:
5654
api-level: 29
5755
script: ./gradlew connectedCheck
58-
- name: Stop local test server
59-
run: docker-compose -p xmtp -f dev/local/docker-compose.yml down
6056

dev/build_validation_service_local

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env sh
2+
set -eu
3+
4+
# Check if x86_64-linux-gnu-gcc is installed AND that the user is on a mac
5+
if [ ! -x "$(command -v x86_64-linux-gnu-gcc)" ] && [ "$(uname)" = "Darwin" ]; then
6+
echo "Installing cross compile toolchain"
7+
brew tap messense/macos-cross-toolchains
8+
brew install x86_64-unknown-linux-gnu
9+
fi
10+
11+
rustup target add x86_64-unknown-linux-gnu
12+
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc
13+
cargo build --release --package mls_validation_service --target x86_64-unknown-linux-gnu
14+
mkdir -p .cache
15+
cp -f ./target/x86_64-unknown-linux-gnu/release/mls-validation-service ./.cache/mls-validation-service
16+
docker build --platform=linux/amd64 -t xmtp/mls-validation-service:latest -f ./dev/validation_service/local.Dockerfile .

dev/local/compose

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
set -eou pipefail
3+
4+
docker-compose -f dev/docker/docker-compose.yml -p "xmtp-android" "$@"

dev/local/up

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -eou pipefail
3+
script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
4+
5+
"${script_dir}"/compose pull
6+
"${script_dir}"/compose up -d --build

dev/up

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
set -eou pipefail
3+
4+
if [[ "${OSTYPE}" == "darwin"* ]]; then
5+
if ! which buf &>/dev/null; then brew install buf; fi
6+
if ! which shellcheck &>/dev/null; then brew install shellcheck; fi
7+
if ! which markdownlint &>/dev/null; then brew install markdownlint-cli; fi
8+
if ! java -version &>/dev/null; then
9+
brew install java
10+
sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk \
11+
/Library/Java/JavaVirtualMachines/
12+
fi
13+
if ! kotlinc -version &>/dev/null; then brew install kotlin; fi
14+
fi
15+
16+
rustup update
17+
18+
dev/build_validation_service_local
19+
dev/local/up

dev/validation_service/Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM rust:1-bullseye as builder
2+
WORKDIR /code
3+
COPY . .
4+
RUN cargo build --release --package mls_validation_service
5+
6+
FROM debian:bullseye-slim
7+
RUN apt-get update && apt-get install -y sqlite3
8+
COPY --from=builder /code/target/release/mls-validation-service /usr/local/bin/mls-validation-service
9+
ENV RUST_LOG=info
10+
CMD ["mls-validation-service"]
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM debian:stable-slim
2+
RUN apt-get update && apt-get install -y sqlite3
3+
COPY .cache/mls-validation-service /usr/local/bin/mls-validation-service
4+
ENV RUST_LOG=info
5+
CMD ["mls-validation-service"]

0 commit comments

Comments
 (0)