Skip to content

Commit a7e3575

Browse files
Merge pull request #2584 from TheBlueMatt/2023-09-msrv-try-2
Correct syn pinning on cargo 1.48
2 parents 36af1f0 + e1707ba commit a7e3575

File tree

2 files changed

+31
-46
lines changed

2 files changed

+31
-46
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
include:
2323
- toolchain: stable
2424
platform: ubuntu-latest
25-
coverage: true
2625
# 1.48.0 is the MSRV for all crates except lightning-transaction-sync and Win/Mac
2726
- toolchain: 1.48.0
2827
platform: ubuntu-latest
@@ -50,46 +49,31 @@ jobs:
5049
run: |
5150
sudo apt-get -y install shellcheck
5251
shellcheck ci/ci-tests.sh
53-
- name: Run CI script with coverage generation
54-
if: matrix.coverage
55-
shell: bash # Default on Winblows is powershell
56-
run: LDK_COVERAGE_BUILD=true ./ci/ci-tests.sh
5752
- name: Run CI script
58-
if: "!matrix.coverage"
5953
shell: bash # Default on Winblows is powershell
6054
run: ./ci/ci-tests.sh
61-
- name: Install deps for kcov
62-
if: matrix.coverage
63-
run: |
64-
sudo apt-get update
65-
sudo apt-get -y install binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev
66-
- name: Install kcov
67-
if: matrix.coverage
68-
run: |
69-
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
70-
tar xzf master.tar.gz
71-
cd kcov-master && mkdir build && cd build
72-
cmake ..
73-
make
74-
make install DESTDIR=../../kcov-build
75-
cd ../.. && rm -rf kcov-master master.tar.gz
76-
- name: Generate coverage report
77-
if: matrix.coverage
78-
run: |
79-
for file in target/debug/deps/lightning*; do
80-
[ -x "${file}" ] || continue;
81-
mkdir -p "target/cov/$(basename $file)";
82-
./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file";
83-
done
84-
- name: Upload coverage
85-
if: matrix.coverage
86-
uses: codecov/codecov-action@v3
55+
56+
coverage:
57+
strategy:
58+
fail-fast: false
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Checkout source code
62+
uses: actions/checkout@v3
8763
with:
64+
fetch-depth: 0
65+
- name: Install Rust stable toolchain
66+
run: |
67+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
68+
- name: Run tests with coverage generation
69+
run: |
70+
cargo install cargo-llvm-cov
71+
export RUSTFLAGS="-Clink-dead-code -Coverflow-checks=off"
72+
cargo llvm-cov --features rest-client,rpc-client,tokio,futures,serde --codecov --hide-instantiations --output-path=target/codecov.json
8873
# Could you use this to fake the coverage report for your PR? Sure.
8974
# Will anyone be impressed by your amazing coverage? No
9075
# Maybe if codecov wasn't broken we wouldn't need to do this...
91-
token: f421b687-4dc2-4387-ac3d-dc3b2528af57
92-
fail_ci_if_error: true
76+
bash <(curl -s https://codecov.io/bash) -f target/codecov.json -t "f421b687-4dc2-4387-ac3d-dc3b2528af57"
9377
9478
benchmark:
9579
runs-on: ubuntu-latest

ci/ci-tests.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,43 +30,44 @@ PIN_RELEASE_DEPS # pin the release dependencies in our main workspace
3030
[ "$RUSTC_MINOR_VERSION" -lt 56 ] && cargo update -p quote --precise "1.0.30" --verbose
3131

3232
# The syn crate depends on too-new proc-macro2 starting with v2.0.33, i.e., has MSRV of 1.56
33-
[ "$RUSTC_MINOR_VERSION" -lt 56 ] && cargo update -p syn:2.0.33 --precise "2.0.32" --verbose
33+
if [ "$RUSTC_MINOR_VERSION" -lt 56 ]; then
34+
SYN_2_DEP=$(grep -o '"syn 2.*' Cargo.lock | tr -d '",' | tr ' ' ':')
35+
cargo update -p "$SYN_2_DEP" --precise "2.0.32" --verbose
36+
fi
3437

3538
# The proc-macro2 crate switched to Rust edition 2021 starting with v1.0.66, i.e., has MSRV of 1.56
3639
[ "$RUSTC_MINOR_VERSION" -lt 56 ] && cargo update -p proc-macro2 --precise "1.0.65" --verbose
3740

3841
# The memchr crate switched to an MSRV of 1.60 starting with v2.6.0
3942
[ "$RUSTC_MINOR_VERSION" -lt 60 ] && cargo update -p memchr --precise "2.5.0" --verbose
4043

41-
[ "$LDK_COVERAGE_BUILD" != "" ] && export RUSTFLAGS="-C link-dead-code"
42-
4344
export RUST_BACKTRACE=1
4445

4546
echo -e "\n\nBuilding and testing all workspace crates..."
4647
cargo test --verbose --color always
47-
cargo build --verbose --color always
48+
cargo check --verbose --color always
4849

4950
echo -e "\n\nBuilding and testing Block Sync Clients with features"
5051
pushd lightning-block-sync
5152
cargo test --verbose --color always --features rest-client
52-
cargo build --verbose --color always --features rest-client
53+
cargo check --verbose --color always --features rest-client
5354
cargo test --verbose --color always --features rpc-client
54-
cargo build --verbose --color always --features rpc-client
55+
cargo check --verbose --color always --features rpc-client
5556
cargo test --verbose --color always --features rpc-client,rest-client
56-
cargo build --verbose --color always --features rpc-client,rest-client
57+
cargo check --verbose --color always --features rpc-client,rest-client
5758
cargo test --verbose --color always --features rpc-client,rest-client,tokio
58-
cargo build --verbose --color always --features rpc-client,rest-client,tokio
59+
cargo check --verbose --color always --features rpc-client,rest-client,tokio
5960
popd
6061

6162
if [[ $RUSTC_MINOR_VERSION -gt 67 && "$HOST_PLATFORM" != *windows* ]]; then
6263
echo -e "\n\nBuilding and testing Transaction Sync Clients with features"
6364
pushd lightning-transaction-sync
6465
cargo test --verbose --color always --features esplora-blocking
65-
cargo build --verbose --color always --features esplora-blocking
66+
cargo check --verbose --color always --features esplora-blocking
6667
cargo test --verbose --color always --features esplora-async
67-
cargo build --verbose --color always --features esplora-async
68+
cargo check --verbose --color always --features esplora-async
6869
cargo test --verbose --color always --features esplora-async-https
69-
cargo build --verbose --color always --features esplora-async-https
70+
cargo check --verbose --color always --features esplora-async-https
7071
popd
7172
fi
7273

@@ -92,7 +93,7 @@ fi
9293
echo -e "\n\nBuilding with all Log-Limiting features"
9394
pushd lightning
9495
grep '^max_level_' Cargo.toml | awk '{ print $1 }'| while read -r FEATURE; do
95-
cargo build --verbose --color always --features "$FEATURE"
96+
cargo check --verbose --color always --features "$FEATURE"
9697
done
9798
popd
9899

0 commit comments

Comments
 (0)