From 83d3d6f56c2069d5a42f4b8862261d216cadc8a0 Mon Sep 17 00:00:00 2001 From: gusto Date: Mon, 4 Sep 2023 10:27:13 +0300 Subject: [PATCH] GH Actions: Fix Windows build (#367) * Remove continue-on-error cases * Skip integration tests for PR and master builds * Use gnu toolchain on windows * Use toolchain instead of target --- .github/workflows/master.yml | 28 +++++++++++++++++++++------- .github/workflows/pr.yml | 27 ++++++++++++++++++++------- 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index a883c1e3..fbc3f6f3 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -25,11 +25,12 @@ jobs: toolchain: stable override: true - uses: actions-rs/cargo@v1 - continue-on-error: true with: command: check args: --all --no-default-features --features ${{ matrix.feature }} + test: + name: Test Suite strategy: fail-fast: false # all OSes should be tested even if one fails (default: true) matrix: @@ -43,21 +44,36 @@ jobs: - uses: actions/setup-go@v3 # we need go to build go-waku with: go-version: '1.19' - - uses: actions-rs/toolchain@v1 + # Setup Rust toolchain with GNU for Windows + - name: Setup Rust with GNU toolchain (Windows) + if: matrix.os == 'windows-latest' + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable-gnu + override: true + # Setup Rust toolchain for other OSes + - name: Setup Rust toolchain (Other OSes) + if: matrix.os != 'windows-latest' + uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true - uses: actions-rs/cargo@v1 - continue-on-error: true with: command: build args: --all --no-default-features --features ${{ matrix.feature }} + # Freeup some space for Windows tests + - name: Clean target dir (Windows) + if: matrix.os == 'windows-latest' + uses: actions-rs/cargo@v1 + with: + command: clean - uses: actions-rs/cargo@v1 - continue-on-error: true with: command: test - args: --all --no-default-features --features ${{ matrix.feature }} + args: --all --no-default-features --features ${{ matrix.feature }} -- --skip ten_nodes_happy --skip two_nodes_happy --skip ten_nodes_one_down lints: name: Rust lints @@ -77,14 +93,12 @@ jobs: - name: Run cargo fmt uses: actions-rs/cargo@v1 - continue-on-error: true with: command: fmt args: --all -- --check - name: Run cargo clippy uses: actions-rs/cargo@v1 - continue-on-error: true with: command: clippy args: --all --no-default-features --features ${{ matrix.feature }} -- --deny warnings diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 1fc583c1..210d352f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -25,7 +25,6 @@ jobs: toolchain: stable override: true - uses: actions-rs/cargo@v1 - continue-on-error: true with: command: check args: --all --no-default-features --features ${{ matrix.feature }} @@ -46,21 +45,37 @@ jobs: - uses: actions/setup-go@v3 # we need go to build go-waku with: go-version: '1.19' - - uses: actions-rs/toolchain@v1 + # Setup Rust toolchain with GNU for Windows + - name: Setup Rust with GNU toolchain (Windows) + if: matrix.os == 'windows-latest' + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable-gnu + target: x86_64-pc-windows-gnu + override: true + # Setup Rust toolchain for other OSes + - name: Setup Rust toolchain (Other OSes) + if: matrix.os != 'windows-latest' + uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true - uses: actions-rs/cargo@v1 - continue-on-error: true with: command: build args: --all --no-default-features --features ${{ matrix.feature }} + # Freeup some space for Windows tests + - name: Clean target dir (Windows) + if: matrix.os == 'windows-latest' + uses: actions-rs/cargo@v1 + with: + command: clean - uses: actions-rs/cargo@v1 - continue-on-error: true with: command: test - args: --all --no-default-features --features ${{ matrix.feature }} + args: --all --no-default-features --features ${{ matrix.feature }} -- --skip ten_nodes_happy --skip two_nodes_happy --skip ten_nodes_one_down lints: name: Rust lints @@ -81,14 +96,12 @@ jobs: - name: Run cargo fmt uses: actions-rs/cargo@v1 - continue-on-error: true with: command: fmt args: --all -- --check - name: Run cargo clippy uses: actions-rs/cargo@v1 - continue-on-error: true with: command: clippy args: --all --no-default-features --features ${{ matrix.feature }} -- --deny warnings