diff --git a/.github/workflows/ci-image.yml b/.github/workflows/ci-image.yml index 14b4778..d058d64 100644 --- a/.github/workflows/ci-image.yml +++ b/.github/workflows/ci-image.yml @@ -31,4 +31,4 @@ jobs: push: false build-args: | VERSION=latest - CARGO_INCREMENTAL=0 \ No newline at end of file + CARGO_INCREMENTAL=0 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f777cb6..55b0025 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -7,12 +7,6 @@ jobs: - uses: actions/checkout@v2 - name: Install Rust run: rustup toolchain install nightly --component llvm-tools-preview - - name: Install anvil - uses: baptiste0928/cargo-install@v2 - with: - crate: anvil - git: https://github.com/foundry-rs/foundry - commit: nightly - name: Install cargo-llvm-cov run: curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin - name: Generate code coverage @@ -20,5 +14,6 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 with: + token: ${{ secrets.CODECOV_TOKEN }} files: lcov.info fail_ci_if_error: true diff --git a/Dockerfile b/Dockerfile index c3d8717..dcc012b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ FROM ghcr.io/xmtp/rust:latest ARG CARGO_INCREMENTAL USER xmtp +ENV USER=xmtp RUN sudo apt update && sudo apt install -y pkg-config openssl libssl-dev @@ -11,17 +12,18 @@ ARG PROJECT=xps-gateway WORKDIR /workspaces/${PROJECT} COPY --chown=xmtp:xmtp . . -ENV PATH=~xmtp/.cargo/bin:$PATH +ENV PATH=~${USER}/.cargo/bin:$PATH ENV USER=xmtp ENV CARGO_INCREMENTAL=${CARGO_INCREMENTAL:-1} RUN cargo check RUN cargo fmt --check RUN cargo clippy --all-features --no-deps -- -D warnings -RUN cargo test -RUN cargo build --release -RUN CARGO_TARGET_DIR=/workspaces/${PROJECT}/target cargo install --path xps-gateway --bin=xps_gateway -RUN valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose ${HOME}/.cargo/bin/xps_gateway --help +RUN cargo test --workspace --all-features +RUN CARGO_TARGET_DIR=/workspaces/${PROJECT}/target cargo install --path xps-gateway --bin=xps_gateway --root=~${USER}/.cargo/ +RUN valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose ~${USER}/.cargo/bin/xps_gateway --help + +CMD RUST_LOG=info cargo run -- --host 0.0.0.0 --port 8080 LABEL org.label-schema.build-date=$BUILD_DATE \ org.label-schema.name="rustdev" \ diff --git a/README.md b/README.md index 28a0ea8..8bdecca 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,15 @@ ![XPS](xps.png) -This *postal service* gateway implements the XMTP transport for registration, inbox and conversations. +This _postal service_ gateway implements the XMTP transport for registration, inbox and conversations. + +[![Test](https://github.com/xmtp/xps-gateway/actions/workflows/ci-image.yml/badge.svg)](https://github.com/xmtp/xps-gateway/actions/workflows/ci-image.yml) +[![codecov](https://codecov.io/gh/xmtp/xps-gateway/graph/badge.svg?token=HXZBPB9GIN)](https://codecov.io/gh/xmtp/xps-gateway) ## Quick Start (Development) -- [READ THE DOCS](https://xmtp.github.io/xps-gateway) -- [CONTRIBUTING](CONTRIBUTING.md) +- [READ THE DOCS](https://xmtp.github.io/xps-gateway) +- [CONTRIBUTING](CONTRIBUTING.md) ### Dev Containers Development