From de9f0b95b3a6506bff5b258f2bdad5de00a265b0 Mon Sep 17 00:00:00 2001 From: Matt George Date: Sun, 30 Oct 2022 04:41:35 -0600 Subject: [PATCH 1/4] run cargo/rustup directly in CI --- .github/workflows/main.yml | 137 ++++++++++--------------------------- 1 file changed, 35 insertions(+), 102 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e240825..e660d75 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,17 +31,11 @@ jobs: - name: "Checkout" uses: actions/checkout@v3 - - name: "Cargo Check" - uses: actions-rs/cargo@v1.0.1 - with: - command: check - args: --no-default-features --features ${{ matrix.features }} + - name: "Check for compiler errors" + run: cargo check --no-default-features --features ${{ matrix.features }} - - name: "Linting" - uses: actions-rs/cargo@v1.0.1 - with: - command: clippy - args: --no-default-features --features ${{ matrix.features }} -- -D warnings + - name: "Run linter" + run: cargo clippy --no-default-features --features ${{ matrix.features }} -- -D warnings formatting_check: needs: code_quality_check @@ -50,18 +44,11 @@ jobs: - name: "Checkout" uses: actions/checkout@v3 - - name: "Set Nightly Rust Toolchain" - uses: "actions-rs/toolchain@v1" - with: - toolchain: nightly - override: true - components: rustfmt + - name: "Install the nightly Rust toolchain" + run: rustup toolchain install -c rustfmt nightly - - name: "Formatting Check" - uses: actions-rs/cargo@v1.0.1 - with: - command: fmt - args: --check + - name: "Check formatting" + run: cargo +nightly fmt --check dependancy_audit: needs: formatting_check @@ -70,10 +57,8 @@ jobs: - name: "Checkout" uses: actions/checkout@v3 - - name: "Audit" - uses: actions-rs/cargo@v1.0.1 - with: - command: audit + - name: "Audit dependancies" + run: cargo audit test_suite: needs: [code_quality_check, formatting_check] @@ -108,11 +93,8 @@ jobs: - name: "Checkout" uses: actions/checkout@v3 - - name: "Cargo Test" - uses: actions-rs/cargo@v1.0.1 - with: - command: test - args: --no-default-features --features ${{ matrix.features }} --no-fail-fast + - name: "Run tests" + run: cargo test --no-default-features --features ${{ matrix.features }} --no-fail-fast os_compat_nix: needs: test_suite @@ -132,17 +114,11 @@ jobs: - name: "Checkout" uses: actions/checkout@v3 - - name: "Cargo Build" - uses: actions-rs/cargo@v1.0.1 - with: - command: build - args: --no-default-features --features ${{ matrix.features }} - - - name: "Cargo Test" - uses: actions-rs/cargo@v1.0.1 - with: - command: test - args: --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub + - name: "Run HTTP test" + run: cargo test --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub + + - name: "Build with release profile" + run: cargo build --release --no-default-features --features ${{ matrix.features }} os_compat_win-msvc: needs: test_suite @@ -157,17 +133,11 @@ jobs: - name: "Checkout" uses: actions/checkout@v3 - - name: "Cargo Build" - uses: actions-rs/cargo@v1.0.1 - with: - command: build - args: --no-default-features --features ${{ matrix.features }} - - - name: "Cargo Test" - uses: actions-rs/cargo@v1.0.1 - with: - command: test - args: --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub + - name: "Run HTTP test" + run: cargo test --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub + + - name: "Build with release profile" + run: cargo build --release --no-default-features --features ${{ matrix.features }} os_compat_win_gnu: needs: test_suite @@ -179,26 +149,17 @@ jobs: - "rustcrypto,rustls-tls" runs-on: windows-latest steps: - - name: "Set GNU Rust Toolchain" - uses: "actions-rs/toolchain@v1" - with: - toolchain: stable-x86_64-pc-windows-gnu - override: true + - name: "Install the stable GNU Rust toolchain" + run: rustup toolchain install stable-x86_64-pc-windows-gnu - name: "Checkout" uses: actions/checkout@v3 - - name: "Cargo Build" - uses: actions-rs/cargo@v1.0.1 - with: - command: build - args: --no-default-features --features ${{ matrix.features }} - - - name: "Cargo Test" - uses: actions-rs/cargo@v1.0.1 - with: - command: test - args: --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub + - name: "Run HTTP test" + run: cargo test --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub --target x86_64-pc-windows-gnu + + - name: "Build with release profile" + run: cargo build --release --no-default-features --features ${{ matrix.features }} --target x86_64-pc-windows-gnu os_compat_win-msvc_openssl: needs: test_suite @@ -218,17 +179,11 @@ jobs: - name: "Checkout" uses: actions/checkout@v3 - - name: "Cargo Build" - uses: actions-rs/cargo@v1.0.1 - with: - command: build - args: --no-default-features --features ${{ matrix.features }} - - - name: "Cargo Test" - uses: actions-rs/cargo@v1.0.1 - with: - command: test - args: --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub + - name: "Run HTTP test" + run: cargo test --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub + + - name: "Build with release profile" + run: cargo build --release --no-default-features --features ${{ matrix.features }} # Commenting this out for now; getting GNU and OpenSSL set up properly on Windows will take some more work # os_compat_win_gnu_openssl: @@ -243,26 +198,4 @@ jobs: # - "openssl-vendored,native-tls-vendored" # runs-on: windows-latest # steps: - # - name: "Install OpenSSL" - # run: vcpkg install openssl:x64-windows-static-md - - # - name: "Set GNU Rust Toolchain" - # uses: "actions-rs/toolchain@v1" - # with: - # toolchain: stable-x86_64-pc-windows-gnu - # override: true - - # - name: "Checkout" - # uses: actions/checkout@v3 - - # - name: "Cargo Build" - # uses: actions-rs/cargo@v1.0.1 - # with: - # command: build - # args: --no-default-features --features ${{ matrix.features }} - - # - name: "Cargo Test" - # uses: actions-rs/cargo@v1.0.1 - # with: - # command: test - # args: --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub + # TODO From b6b5cbf1bba66ddc0c5f1061c1ca2e1010f1cd4b Mon Sep 17 00:00:00 2001 From: Matt George Date: Sun, 30 Oct 2022 04:49:31 -0600 Subject: [PATCH 2/4] fix toolchain command --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e660d75..6b1fe47 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,7 +45,7 @@ jobs: uses: actions/checkout@v3 - name: "Install the nightly Rust toolchain" - run: rustup toolchain install -c rustfmt nightly + run: rustup toolchain install nightly -c rustfmt - name: "Check formatting" run: cargo +nightly fmt --check From 770f0d37df4fd7685fcc66ed7ae0f12b193da180 Mon Sep 17 00:00:00 2001 From: Matt George Date: Sun, 30 Oct 2022 05:10:42 -0600 Subject: [PATCH 3/4] win gnu fix --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b1fe47..ed91fac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -150,16 +150,16 @@ jobs: runs-on: windows-latest steps: - name: "Install the stable GNU Rust toolchain" - run: rustup toolchain install stable-x86_64-pc-windows-gnu + run: rustup toolchain install stable-gnu - name: "Checkout" uses: actions/checkout@v3 - name: "Run HTTP test" - run: cargo test --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub --target x86_64-pc-windows-gnu + run: cargo +stable-gnu test --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub - name: "Build with release profile" - run: cargo build --release --no-default-features --features ${{ matrix.features }} --target x86_64-pc-windows-gnu + run: cargo +stable-gnu build --release --no-default-features --features ${{ matrix.features }} os_compat_win-msvc_openssl: needs: test_suite From 87eaf20be2c5cd0b481e3864528944a8f7f70ec6 Mon Sep 17 00:00:00 2001 From: Matt George Date: Sun, 30 Oct 2022 05:50:14 -0600 Subject: [PATCH 4/4] removing extra build step in os compat tests --- .github/workflows/main.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ed91fac..90499eb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -117,9 +117,6 @@ jobs: - name: "Run HTTP test" run: cargo test --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub - - name: "Build with release profile" - run: cargo build --release --no-default-features --features ${{ matrix.features }} - os_compat_win-msvc: needs: test_suite strategy: @@ -136,9 +133,6 @@ jobs: - name: "Run HTTP test" run: cargo test --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub - - name: "Build with release profile" - run: cargo build --release --no-default-features --features ${{ matrix.features }} - os_compat_win_gnu: needs: test_suite strategy: @@ -158,9 +152,6 @@ jobs: - name: "Run HTTP test" run: cargo +stable-gnu test --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub - - name: "Build with release profile" - run: cargo +stable-gnu build --release --no-default-features --features ${{ matrix.features }} - os_compat_win-msvc_openssl: needs: test_suite strategy: @@ -182,9 +173,6 @@ jobs: - name: "Run HTTP test" run: cargo test --no-default-features --features ${{ matrix.features }} --no-fail-fast http_logs_from_pub - - name: "Build with release profile" - run: cargo build --release --no-default-features --features ${{ matrix.features }} - # Commenting this out for now; getting GNU and OpenSSL set up properly on Windows will take some more work # os_compat_win_gnu_openssl: # needs: test_suite