From 2b2bf9514b62e52458ce2f720d9cc0a9cf1d2b55 Mon Sep 17 00:00:00 2001 From: John Cairns Date: Thu, 25 Jan 2024 17:08:52 -0600 Subject: [PATCH] 43: codecov access token (#44) --- .github/workflows/ci-image.yml | 2 +- .github/workflows/coverage.yml | 31 ++++++++++++++++--------------- Dockerfile | 10 +++++----- README.md | 8 +++++--- 4 files changed, 27 insertions(+), 24 deletions(-) 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 c810fde..837c758 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,18 +1,19 @@ name: Coverage on: [pull_request, push] jobs: - coverage: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install Rust - run: rustup toolchain install nightly --component llvm-tools-preview - - 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 - run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - files: lcov.info - fail_ci_if_error: true + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Rust + run: rustup toolchain install nightly --component llvm-tools-preview + - 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 + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + - 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 1491053..20f199c 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 @@ -9,17 +10,16 @@ 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 LABEL org.label-schema.build-date=$BUILD_DATE \ org.label-schema.name="rustdev" \ diff --git a/README.md b/README.md index 28a0ea8..1cea212 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,14 @@ ![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. + +[![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