diff --git a/.github/workflows/build-ffi.yml b/.github/workflows/build-ffi.yml index 04497d61..042c5bc2 100644 --- a/.github/workflows/build-ffi.yml +++ b/.github/workflows/build-ffi.yml @@ -1,6 +1,22 @@ name: Pact-Rust FFI Build -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true + +env: + RUST_BACKTRACE: "1" + RUST_LOG: "debug" + PACT_DO_NOT_TRACK: "true" + CARGO_TERM_COLOR: always jobs: build: @@ -10,8 +26,6 @@ jobs: matrix: operating-system: [ ubuntu-latest, windows-latest, macos-13, macos-14 ] rust: [ stable ] - env: - pact_do_not_track: true steps: - uses: actions/checkout@v3 - run: rustc --version || true @@ -19,13 +33,14 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: toolchain: stable + components: rustfmt + - uses: Swatinem/rust-cache@v2 + with: + workspaces: rust + shared-key: ${{ runner.os }} - name: Install shared mime info DB if: runner.os == 'macOS' run: brew install shared-mime-info - - uses: dtolnay/rust-toolchain@nightly - with: - toolchain: nightly - components: rustfmt - name: Install doxygen if: runner.os == 'Linux' run: sudo apt-get install -y doxygen diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c41762c..68cafa64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,22 @@ name: Pact-Rust Build -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true + +env: + RUST_BACKTRACE: "1" + RUST_LOG: "debug" + PACT_DO_NOT_TRACK: "true" + CARGO_TERM_COLOR: always jobs: build: @@ -10,31 +26,23 @@ jobs: matrix: operating-system: [ ubuntu-latest, windows-latest, macos-13, macos-14 ] rust: [ stable ] - env: - pact_do_not_track: true steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable with: toolchain: stable components: clippy + - uses: taiki-e/install-action@v2 + with: + tool: cargo-nextest - name: Install shared mime info DB if: runner.os == 'macOS' run: brew install shared-mime-info - name: Tests - run: cargo test + run: cargo nextest run working-directory: rust - env: - RUST_LOG: debug - RUST_BACKTRACE: 1 - name: Run mock_server_logs test - run: cargo test -p pact_ffi returns_mock_server_logs -- --nocapture --include-ignored - working-directory: rust - env: - RUST_LOG: debug - RUST_BACKTRACE: 1 - - name: Build Components - run: cargo build + run: cargo nextest run -p pact_ffi returns_mock_server_logs -- --include-ignored working-directory: rust - name: Clippy if: runner.os == 'Linux' @@ -43,10 +51,24 @@ jobs: musl-build: runs-on: ubuntu-latest + container: + image: pactfoundation/rust-musl-build steps: - uses: actions/checkout@v3 - - run: | - docker run --rm --user "$(id -u)":"$(id -g)" -v $(pwd):/workspace -w /workspace/rust -t -e TZ=UTC pactfoundation/rust-musl-build ./scripts/ci-musl-build.sh + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + components: clippy + - uses: taiki-e/install-action@v2 + with: + tool: cargo-nextest + - uses: Swatinem/rust-cache@v2 + with: + workspaces: rust + shared-key: ${{ runner.os }}-musl + - name: Tests + run: cargo nextest run + working-directory: rust check-features: @@ -55,4 +77,3 @@ jobs: - uses: actions/checkout@v3 - run: cargo check --no-default-features working-directory: rust - diff --git a/.github/workflows/compatability-suite.yml b/.github/workflows/compatability-suite.yml index b2a03729..175d7ef2 100644 --- a/.github/workflows/compatability-suite.yml +++ b/.github/workflows/compatability-suite.yml @@ -1,56 +1,44 @@ name: Pact-Rust Compatibility Suite -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true env: - pact_do_not_track: true + RUST_BACKTRACE: "1" + RUST_LOG: "debug" + PACT_DO_NOT_TRACK: "true" + CARGO_TERM_COLOR: always jobs: - v1: - runs-on: ${{ matrix.operating-system }} - strategy: - fail-fast: false - matrix: - operating-system: [ ubuntu-latest, windows-latest, macos-13, macos-14 ] - steps: - - uses: actions/checkout@v2 - - uses: dtolnay/rust-toolchain@stable - - name: Run Cucumber - run: cargo test --test v1* - working-directory: compatibility-suite - v2: - runs-on: ${{ matrix.operating-system }} - strategy: - fail-fast: false - matrix: - operating-system: [ ubuntu-latest, windows-latest, macos-13, macos-14 ] - steps: - - uses: actions/checkout@v2 - - uses: dtolnay/rust-toolchain@stable - - name: Run Cucumber - run: cargo test --test v2* - working-directory: compatibility-suite - v3: - runs-on: ${{ matrix.operating-system }} - strategy: - fail-fast: false - matrix: - operating-system: [ ubuntu-latest, windows-latest, macos-13, macos-14 ] - steps: - - uses: actions/checkout@v2 - - uses: dtolnay/rust-toolchain@stable - - name: Run Cucumber - run: cargo test --test v3* - working-directory: compatibility-suite - v4: + compatibility-suite: runs-on: ${{ matrix.operating-system }} strategy: fail-fast: false matrix: - operating-system: [ ubuntu-latest, windows-latest, macos-13, macos-14 ] + operating-system: [ubuntu-latest, windows-latest, macos-13, macos-14] steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable + - uses: taiki-e/install-action@v2 + with: + tool: cargo-nextest + - uses: Swatinem/rust-cache@v2 + with: + workspaces: | + rust + compatibility-suite + shared-key: ${{ runner.os }} - name: Run Cucumber - run: cargo test --test v4* + # Note: cucumber's test executables are incompatible with nextest + # See: https://github.com/nextest-rs/nextest/issues/1329 + run: cargo test working-directory: compatibility-suite diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 25074dd5..fee21da6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,12 @@ concurrency: group: release-${{ github.ref }} cancel-in-progress: true +env: + RUST_BACKTRACE: "1" + RUST_LOG: "debug" + PACT_DO_NOT_TRACK: "true" + CARGO_TERM_COLOR: always + jobs: build-release: name: build-release (${{ matrix.targets }}) @@ -43,9 +49,6 @@ jobs: targets: aarch64-apple-darwin fail-fast: false - env: - pact_do_not_track: true - steps: - uses: actions/checkout@v4 @@ -59,10 +62,10 @@ jobs: uses: Swatinem/rust-cache@v2 with: workspaces: rust - key: ${{ matrix.targets }} + shared-key: ${{ runner.os }} - name: Set up QEMU - if: runner.os == 'Linux' + if: runner.os == 'Linux' && startsWith(matrix.targets, 'aarch64') uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx