Skip to content

Commit

Permalink
Merge pull request #480 from pact-foundation/chore/reduce-ci-usage
Browse files Browse the repository at this point in the history
chore: reduce ci usage
  • Loading branch information
rholshausen authored Dec 11, 2024
2 parents 74df5d1 + f80cf9f commit 2a99a11
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 70 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/build-ffi.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -10,22 +26,21 @@ 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
shell: bash
- 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
Expand Down
55 changes: 38 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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'
Expand All @@ -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:
Expand All @@ -55,4 +77,3 @@ jobs:
- uses: actions/checkout@v3
- run: cargo check --no-default-features
working-directory: rust

70 changes: 29 additions & 41 deletions .github/workflows/compatability-suite.yml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }})
Expand All @@ -43,9 +49,6 @@ jobs:
targets: aarch64-apple-darwin
fail-fast: false

env:
pact_do_not_track: true

steps:
- uses: actions/checkout@v4

Expand All @@ -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
Expand Down

0 comments on commit 2a99a11

Please sign in to comment.