Skip to content

Commit

Permalink
fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
RomarQ committed Jan 23, 2025
1 parent 66da592 commit 81cfabb
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 20 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/target/
**/node_modules/
.git
Dockerfile
8 changes: 0 additions & 8 deletions .github/workflow-templates/cargo-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ inputs:
runs:
using: "composite"
steps:
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Setup Variables
shell: bash
run: |
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "SCCACHE_CACHE_SIZE=100GB" >> $GITHUB_ENV
- name: Build moonbeam
shell: bash
run: |
Expand Down
36 changes: 26 additions & 10 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,29 @@ jobs:
echo "RUSTFLAGS=-C opt-level=3 -D warnings -C instrument-coverage -C linker=clang -C link-arg=-fuse-ld=$(pwd)/mold/bin/mold" >> $GITHUB_ENV
# Disable coverage when building
echo "LLVM_PROFILE_FILE=/dev/null" >> $GITHUB_ENV
- name: Setup grcov
run: |
wget https://github.com/mozilla/grcov/releases/download/v${{ env.GRCOV_VERSION }}/grcov-x86_64-unknown-linux-gnu.tar.bz2
tar xvf grcov-x86_64-unknown-linux-gnu.tar.bz2
chmod +x grcov
- name: Install llvm tools
run: rustup component add llvm-tools-preview
- name: Cargo build
uses: ./.github/workflow-templates/cargo-build
with:
features: metadata-hash
- name: Setup Mold Linker
shell: bash
run: |
mkdir -p mold
curl -L --retry 10 --silent --show-error https://github.com/rui314/mold/releases/download/v2.30.0/mold-2.30.0-$(uname -m)-linux.tar.gz | tar -C $(realpath mold) --strip-components=1 -xzf -
- name: Setup Rust toolchain
shell: bash
run: |
if ! which "rustup" > /dev/null; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
fi
rustup override unset
rustup show
rustup target add wasm32-unknown-unknown
- name: Build Node
shell: bash
run: |
env
params=" --locked --release -p moonbeam --features metadata-hash"
echo "cargo build $params"
cargo build $params
- name: Enable coverage gathering
run: |
# Enable coverage when running tests
Expand All @@ -138,7 +150,11 @@ jobs:
with:
moonwall_environment: dev_moonbase
force-pass: true

- name: Setup grcov
run: |
wget https://github.com/mozilla/grcov/releases/download/v${{ env.GRCOV_VERSION }}/grcov-x86_64-unknown-linux-gnu.tar.bz2
tar xvf grcov-x86_64-unknown-linux-gnu.tar.bz2
chmod +x grcov
- name: Retrieve coverage
id: coverage
run: |
Expand Down
1 change: 1 addition & 0 deletions docker/moonbeam-builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARG RUSTFLAGS="-C opt-level=3 -D warnings -C linker=clang -C link-arg=-fuse-ld=/
ENV BUILD_PARAMS=$BUILD_PARAMS
ENV RUSTFLAGS=$RUSTFLAGS
ENV DEBIAN_FRONTEND=noninteractive
ENV CARGO_INCREMENTAL=0

WORKDIR /build
COPY . /build/
Expand Down
4 changes: 2 additions & 2 deletions docker/moonbeam-production.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Node for Moonbeam
# Production Node for Moonbeam
#
# Requires to run from repository root and to copy the binary in the build folder (part of the release workflow)

Expand Down Expand Up @@ -50,7 +50,7 @@ RUN cargo build --profile=production --all

FROM debian:stable-slim
LABEL maintainer="[email protected]"
LABEL description="Binary for Moonbeam Nodes"
LABEL description="Production Binary for Moonbeam Nodes"

RUN useradd -m -u 1000 -U -s /bin/sh -d /moonbeam moonbeam && \
mkdir -p /moonbeam/.local/share && \
Expand Down

0 comments on commit 81cfabb

Please sign in to comment.