Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/compat-plugins.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
name: Compatibility suite (V4 plugins)

# The V4 plugin features are not in the pinned suite submodule yet, so this
# checks out the suite branch that adds them and runs `tests/plugins.rs` in
# compatibility-suite against it. It runs on draft PRs and on PRs to any
# base, unlike test.yml.
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
inputs:
suite-repository:
description: pact-compatibility-suite repository with features/V4/plugins
default: YOU54F/pact-compatibility-suite
suite-ref:
description: Ref of that repository to run
default: feat/plugin-features

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
FORCE_COLOR: '1'
PACT_DO_NOT_TRACK: 'true'
SUITE_REPOSITORY: ${{ inputs.suite-repository || 'YOU54F/pact-compatibility-suite' }}
SUITE_REF: ${{ inputs.suite-ref || 'feat/plugin-features' }}

jobs:
plugins:
name: Rust plugins (ubuntu-latest)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Checkout plugin suite
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: ${{ env.SUITE_REPOSITORY }}
ref: ${{ env.SUITE_REF }}
path: pact-compatibility-suite-plugins

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0
with:
build-warnings: warn
cache-workspaces: compatibility-suite -> target
cache-save-if: ${{ github.ref == 'refs/heads/master' }}

- name: Install the Pact CLI
uses: pact-foundation/pact-cli@ce8e65692ad3ea9d11244749ae24c8c49225d95f # main

- name: Install plugins
run: |
# matt is not in the plugin repository index, so it is installed from its release.
pact plugin install https://github.com/mefellows/pact-matt-plugin/releases/tag/v0.1.1 -y
pact plugin install csv --version 0.0.6 -y
pact plugin install avro --version 0.1.3 -y
pact plugin install protobuf --version 0.8.0 -y

- name: Run plugin features
working-directory: compatibility-suite
run: cargo test --test plugins
env:
PACT_COMPAT_SUITE: ${{ github.workspace }}/pact-compatibility-suite-plugins
7 changes: 7 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ Follow [Conventional Changelog](https://github.com/bcoe/conventional-changelog-s

BDD-style integration tests covering V1–V4 spec compliance live in `/compatibility-suite/`. These use the `cucumber` framework and run separately from the main workspace tests.

The V4 plugin features (`tests/plugins.rs`) need the matt, csv, avro and protobuf plugins installed, and read the suite from `PACT_COMPAT_SUITE` (default `pact-compatibility-suite`); they are skipped when that suite has no `features/V4/plugins`:

```bash
cd compatibility-suite
PACT_COMPAT_SUITE=/path/to/pact-compatibility-suite cargo test --test plugins
```

## Releasing

See RELEASING.md: per-crate draft release PRs (release-plz), tags `<crate>-v<version>`, dist builds, crates.io trusted publishing.
7 changes: 7 additions & 0 deletions compatibility-suite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ async-trait = "0.1.74"
base64 = "0.23.1"
bytes = "1.5.0"
cucumber = "0.23.0"
h2 = "0.4"
http = "1"
itertools = "0.15.0"
lazy_static = "1.5.0"
maplit = "1.0.2"
pact_consumer = { path = "../rust/pact_consumer" }
pact_models = { version = "1.3.16" }
pact_matching = { version = "2.0.11" }
pact_mock_server = { version = "2.2.6" }
pact-plugin-driver = "*"
pact_verifier = { path = "../rust/pact_verifier" }
regex = "1.10.2"
reqwest = { version = "0.13.4", default-features = false, features = ["json"] }
Expand Down Expand Up @@ -66,3 +69,7 @@ harness = false
[[test]]
name = "v4"
harness = false

[[test]]
name = "plugins"
harness = false
Loading
Loading