From 90b386a489cf721a5b4579cbd38800c63f194cef Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Sat, 26 Dec 2020 15:22:49 +0100 Subject: [PATCH 1/5] Check all code in rustfmt on CI --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 42888f3d..5d372adb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,7 +42,8 @@ jobs: - uses: actions/checkout@master - name: Install Rust run: rustup update stable && rustup default stable && rustup component add rustfmt - - run: cargo fmt -- --check + - name: Check formatting + run: cargo fmt --all -- --check check: name: Check From 363602d0daa89e6b5922fd320bdc03fce42da849 Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Sat, 26 Dec 2020 15:31:14 +0100 Subject: [PATCH 2/5] Run CI on current and v0.3.x branches --- .github/workflows/main.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5d372adb..d63706ac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,11 +1,15 @@ name: CI -on: [push, pull_request] +on: + push: + branches: [ master, "v0.3.x" ] + pull_request: + branches: [ master, "v0.3.x" ] env: CARGO_TERM_COLOR: always RUST_BACKTRACE: full jobs: - test: + Test: name: Test runs-on: ${{ matrix.os }} strategy: @@ -35,7 +39,7 @@ jobs: - run: cargo test - run: cargo test --features all - rustfmt: + Rustfmt: name: Rustfmt runs-on: ubuntu-latest steps: @@ -45,7 +49,7 @@ jobs: - name: Check formatting run: cargo fmt --all -- --check - check: + Check: name: Check runs-on: ubuntu-latest strategy: @@ -60,7 +64,7 @@ jobs: - run: cargo check --target ${{ matrix.target }} --all-targets --examples --bins --tests --all-features continue-on-error: true - publish_docs: + Publish_docs: name: Publish Documentation runs-on: ubuntu-latest steps: From 206b2a09ba3fb21cd2b1e68456e62af60367d68e Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Sat, 26 Dec 2020 15:32:03 +0100 Subject: [PATCH 3/5] Test with all combinations of features on CI --- .github/workflows/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d63706ac..9b988466 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,8 +36,10 @@ jobs: - name: Install Rust (rustup) run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} shell: bash - - run: cargo test - - run: cargo test --features all + - name: Install cargo-hack + run: cargo install cargo-hack + - name: Run tests + run: cargo hack test --feature-powerset && cargo hack test --feature-powerset --release Rustfmt: name: Rustfmt From 2b378159b621880f7475eb35826955f0d7c8386e Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Sat, 26 Dec 2020 15:26:42 +0100 Subject: [PATCH 4/5] Add more targets to check on CI --- .github/workflows/main.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9b988466..05e0ebd3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,15 +56,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - target: [x86_64-unknown-redox, x86_64-fuchsia] + target: ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-fuchsia", "x86_64-pc-windows-msvc", "x86_64-sun-solaris", "x86_64-unknown-freebsd", "x86_64-unknown-linux-gnu", "x86_64-unknown-netbsd", "x86_64-unknown-redox"] steps: - uses: actions/checkout@master - name: Install Rust - run: rustup update nightly && rustup default nightly - - run: rustup target add ${{ matrix.target }} - - run: cargo check --target ${{ matrix.target }} --all-targets --examples --bins --tests --no-default-features - - run: cargo check --target ${{ matrix.target }} --all-targets --examples --bins --tests --all-features - continue-on-error: true + run: rustup update stable && rustup default stable + - name: Install cargo-hack + run: cargo install cargo-hack + - name: Install Target + run: rustup target add ${{ matrix.target }} + - name: Run check + run: cargo hack check --feature-powerset --all-targets --examples --bins --tests --target ${{ matrix.target }} Publish_docs: name: Publish Documentation From 46a3318bff2b945efe1765e0b88560279fb2f90b Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Sat, 26 Dec 2020 16:00:06 +0100 Subject: [PATCH 5/5] Ignore Fuchsia and Redox targets They are currently broken. --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 05e0ebd3..05e1e24c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,7 +56,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - target: ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-fuchsia", "x86_64-pc-windows-msvc", "x86_64-sun-solaris", "x86_64-unknown-freebsd", "x86_64-unknown-linux-gnu", "x86_64-unknown-netbsd", "x86_64-unknown-redox"] + # TODO: add the following targets, currently broken. + # "x86_64-fuchsia" + # "x86_64-unknown-redox" + target: ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "x86_64-sun-solaris", "x86_64-unknown-freebsd", "x86_64-unknown-linux-gnu", "x86_64-unknown-netbsd"] steps: - uses: actions/checkout@master - name: Install Rust