Skip to content

Commit ff7d747

Browse files
Integrate rustfmt into travis and Github Actions.
1 parent 5a3ec62 commit ff7d747

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.github/workflows/build.yml

+5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ 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
2527
runs-on: ubuntu-latest
2628
steps:
2729
- name: Checkout source code
@@ -32,6 +34,9 @@ jobs:
3234
toolchain: ${{ matrix.toolchain }}
3335
override: true
3436
profile: minimal
37+
- name: Check formatting
38+
if: matrix.check-fmt
39+
run: rustup component add rustfmt && cargo fmt --all -- --check && cd fuzz && cargo fmt --all -- --check
3540
- name: Build on Rust ${{ matrix.toolchain }} with net-tokio
3641
if: matrix.build-net-tokio
3742
run: RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always

.travis.yml

+3
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)