Skip to content

Commit

Permalink
Fix test error with coverage (#24)
Browse files Browse the repository at this point in the history
* Fix Dynamic linking error on MacOS

* Fix script error

* Update cli.sh

* Update CI.yml

* Update cli.sh

* Run CI normally
  • Loading branch information
linw1995 authored Oct 3, 2024
1 parent 37235e8 commit d8a49f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,20 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt install -yq \
build-essential \
musl-dev \
musl-tools
libssl-dev \
pkg-config
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: x86_64-unknown-linux-musl

- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: cargo-install cargo-tarpaulin
uses: baptiste0928/[email protected]
with:
crate: cargo-tarpaulin
git: https://github.com/xd009642/tarpaulin.git
- name: cargo-install diesel_cli
uses: baptiste0928/[email protected]
with:
Expand All @@ -75,7 +72,6 @@ jobs:
run: |
./scripts/cli.sh lint
env:
CARGO_BUILD_TARGET: x86_64-unknown-linux-musl
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"

Expand All @@ -84,7 +80,6 @@ jobs:
source .envrc
./scripts/cli.sh coverage-xml
env:
CARGO_BUILD_TARGET: x86_64-unknown-linux-musl
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
RUST_LOG: bearmark=debug,rocket=info
Expand Down
8 changes: 6 additions & 2 deletions scripts/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ cleanup_profraw_files() {

cd "$(dirname "$0")"/../

tarpaulin_args="--workspace --exclude bearmark-macro --include-tests --skip-clean --out html -- --show-output --test-threads 1"
tarpaulin_xml_args="--workspace --exclude bearmark-macro --include-tests --skip-clean --out xml -- --show-output --test-threads 1"
tarpaulin_args="--workspace --include-tests --skip-clean --out html --engine llvm -- --show-output --test-threads 1"
tarpaulin_xml_args="--workspace --include-tests --skip-clean --out xml --engine llvm -- --show-output --test-threads 1"

export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src"
export DYLD_LIBRARY_PATH="$(rustc --print sysroot)/lib:${DYLD_LIBRARY_PATH-}" # MacOS
export LD_LIBRARY_PATH="$(rustc --print sysroot)/lib:${LD_LIBRARY_PATH-}" # Linux

main() {
action=${1-}
Expand Down

0 comments on commit d8a49f6

Please sign in to comment.