Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ Key architectural boundaries:
- `pact_models` is patched in `rust/Cargo.toml` via `[patch.crates-io]` to the local path. Changes there automatically affect workspace crates without publishing.
- Logging and test output are centered on `tracing`/`tracing-subscriber`; tests commonly use `test-log` so `RUST_LOG=debug` is useful when debugging failures.
- Common test helpers across crates are `rstest`, `expectest`, `hamcrest2`, and `pretty_assertions`. Follow those existing choices before introducing new test utilities.
- CI exercises more than the default happy path: full workspace build/test, Linux `cargo clippy`, `cargo check --no-default-features`, WASM builds for `pact_models` and `pact_matching`, and a separate run with `PACT_MATCHING_ENGINE=v2`.
- CI (`.github/workflows/test.yml`) runs on Linux, macOS and Windows: nextest plus doctests, the compatibility suite, the FFI C examples, a musl build, `cargo hack check --each-feature`, WASM builds for `pact_models` and `pact_matching`, Linux `cargo clippy`, and an advisory run with `PACT_MATCHING_ENGINE=v2`.
- Commit messages follow Conventional Changelog style (`feat:`, `fix:`, `chore:`, `refactor:`).
37 changes: 37 additions & 0 deletions .github/scripts/ffi-examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Builds pact_ffi in release through its CMake project, installs it under
# rust/pact_ffi/build/install (lib/ + include/pact.h), then builds and runs
# every example in rust/pact_ffi/examples/ against that install.
set -euo pipefail

cd "$(dirname "$0")/../../rust/pact_ffi"
install_dir="$PWD/build/install"

# MARK: Library

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
cmake --build build --config Release --target generate_header
cmake --install build --config Release --prefix "$install_dir"

# MARK: Examples

for example in examples/*/; do
name=$(basename "$example")
build_dir="build/examples/$name"
echo "::group::Example $name"
cmake -S "$example" -B "$build_dir" -DCMAKE_BUILD_TYPE=Release
cmake --build "$build_dir" --config Release
case "$(uname -s)" in
MINGW* | MSYS* | CYGWIN*)
PATH="$install_dir/lib:$PATH" "$build_dir/Release/example.exe"
;;
Darwin)
DYLD_LIBRARY_PATH="$install_dir/lib" "$build_dir/example"
;;
*)
LD_LIBRARY_PATH="$install_dir/lib" "$build_dir/example"
;;
esac
echo "::endgroup::"
done
79 changes: 0 additions & 79 deletions .github/workflows/build-ffi.yml

This file was deleted.

100 changes: 0 additions & 100 deletions .github/workflows/build.yml

This file was deleted.

78 changes: 0 additions & 78 deletions .github/workflows/compatability-suite.yml

This file was deleted.

20 changes: 14 additions & 6 deletions .github/workflows/issue-comment-created.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,34 @@ on:
types:
- created

permissions:
issues: write

jobs:
jira:
runs-on: ubuntu-latest
if: ${{ github.event.comment.body == '/jira ticket' }}
steps:
- run: echo ${{ github.event.comment.body }}
- env:
COMMENT_BODY: ${{ github.event.comment.body }}
run: echo "$COMMENT_BODY"

- name: Login
uses: atlassian/gajira-login@v3
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: SearchParam
run: echo 'summary ~ ${{ toJSON(github.event.issue.title)}} AND project=${{ secrets.JIRA_PROJECT }}'
env:
ISSUE_TITLE: ${{ toJSON(github.event.issue.title) }}
JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }}
run: echo "summary ~ ${ISSUE_TITLE} AND project=${JIRA_PROJECT}"

- name: Search
id: search
uses: tomhjp/gh-action-jira-search@v0.1.0
uses: tomhjp/gh-action-jira-search@e099f122d99bf8f12707c157a98166b16498466c # v0.1.0
with:
jql: 'summary ~ ${{ toJSON(github.event.issue.title)}} AND project=${{ secrets.JIRA_PROJECT }}'

Expand All @@ -34,7 +42,7 @@ jobs:
- name: Create
id: create
if: steps.search.outputs.issue == ''
uses: atlassian/gajira-create@v3
uses: atlassian/gajira-create@1ff0b6bd115a780592b47bfbb63fc4629132e6ec # v3
with:
project: ${{ secrets.JIRA_PROJECT }}
issuetype: Task
Expand All @@ -47,7 +55,7 @@ jobs:

- name: Add Comment
if: steps.search.outputs.issue == '' && steps.create.outputs.issue != ''
uses: actions/github-script@v5
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ on:
types:
- published

pull_request:
branches:
- master

workflow_dispatch:

jobs:
Expand Down Expand Up @@ -42,12 +38,14 @@ jobs:
steps:
- uses: actions/checkout@v4

# With no `toolchain` input, the action installs the one pinned in
# rust-toolchain.toml and adds the matrix target to it.
- name: Install release Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0
with:
# Rust 1.99 miscompiles C bool returns on Linux x86_64 (rust-lang/rust#163911).
toolchain: 1.98.1
targets: ${{ matrix.targets }}
target: ${{ matrix.targets }}
build-warnings: warn
cache: false

- name: Rust caching
uses: Swatinem/rust-cache@v2
Expand Down
Loading
Loading