Skip to content

Commit f4371a2

Browse files
Integrate rustfmt into travis and Github Actions.
1 parent a9d0a9a commit f4371a2

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ jobs:
1717
include:
1818
- toolchain: stable
1919
build-net-tokio: true
20+
check-fmt: true
2021
- toolchain: beta
2122
build-net-tokio: true
2223
- toolchain: 1.39.0
2324
build-net-tokio: true
2425
coverage: true
26+
- toolchain: 1.34.2
27+
check-fuzz-fmt: true
2528
runs-on: ubuntu-latest
2629
steps:
2730
- name: Checkout source code
@@ -32,6 +35,11 @@ jobs:
3235
toolchain: ${{ matrix.toolchain }}
3336
override: true
3437
profile: minimal
38+
- name: Check formatting
39+
if: matrix.check-fmt
40+
run: rustup component add rustfmt && cargo fmt --all -- --check
41+
if: matrix.check-fuzz-fmt
42+
run: rustup component add rustfmt && cd fuzz && cargo fmt --all -- --check
3543
- name: Build on Rust ${{ matrix.toolchain }} with net-tokio
3644
if: matrix.build-net-tokio
3745
run: RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ before_install:
1515
- sudo apt-get install -y binutils-dev libunwind8-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev
1616

1717
script:
18+
# Check formatting
19+
- if [ "$(rustup show | grep stable)" != "" ]; then rustup component add rustfmt && cargo fmt --all -- --check; fi
20+
- if [ "$(rustup show | grep 1.34.2)" != "" ]; then rustup component add rustfmt && cd fuzz && cargo fmt --all -- --check && cd ../; fi
1821
# Support lightning-net-tokio only on Rust stable, beta, and 1.39.0
1922
- if [ "$(rustup show | grep default | grep '1.39.0')" != "" ]; then export BUILD_NET_TOKIO=1; fi
2023
- if [ "$(rustup show | grep default | grep '1\.')" == "" ]; then export BUILD_NET_TOKIO=1; fi

0 commit comments

Comments
 (0)