Skip to content

Commit

Permalink
Merge branch 'master' into fix/numeric-provider-state-param
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Jun 9, 2024
2 parents 7d5560d + 0996c4e commit 08561f9
Show file tree
Hide file tree
Showing 196 changed files with 3,723 additions and 3,787 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* text=auto

*.sh text eol=lf
*.sln text eol=crlf
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug, triage
assignees: ''

---

**Previous issues**
Have you searched the issue tracker to ensure this hasn't been discussed before?

**Version information:**
- OS: (e.g. MacOS ARM, Windows x64)
- PactNet Version:
- .Net Version:
- Pact Broker Version (if applicable):

**Describe the bug**
A clear and concise description of what the bug is.

**Steps To Reproduce**
Steps to reproduce the issue, including code snippets or preferably a link to a repository which reproduces the issue.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Log Output**
Applicable log output. Please ensure you remove any sensitive information.

**Additional context**
Add any other context about the problem here.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Feature request
about: Suggest an idea for this project
title: 'RFC: <title>'
labels: triage
assignees: ''

---

**Previous issues**
Have you searched the issue tracker to ensure this hasn't been discussed before?

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Breaking Changes**
Does your proposed change include anything which would require a major version bump? If so, please detail them here. Please read the SemVer spec if you are unsure what this means.

**Potential Downsides/Caveats**
A clear and concise description of any downsides or caveats your change would introduce.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
36 changes: 27 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
Expand All @@ -17,17 +17,34 @@ jobs:
- windows-latest
- ubuntu-latest
- macos-12
- macos-14
include:
- arch: x64
- arch: ARM64
os: macos-14
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: "6.0.x" # runners already have .Net Framework installed as well
dotnet-version: "8.0.x" # runners already have .Net Framework installed as well

- name: Cache FFI dependencies
id: cache
uses: actions/cache@v4
with:
key: cache-ffi-${{ hashFiles('build/download-native-libs.sh') }}
enableCrossOsArchive: true
path: |
build/linux
build/osx
build/windows
- name: Pull interop dependencies
run: bash -c "build/download-native-libs.sh"
if: ${{ steps.cache.outputs.cache-hit != 'true' }}

- name: Restore
run: dotnet restore
Expand All @@ -36,15 +53,15 @@ jobs:
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal -- RunConfiguration.TargetPlatform=x64
run: dotnet test --no-build --verbosity normal -- RunConfiguration.TargetPlatform=${{matrix.arch}}

- name: Pack
if: matrix.os == 'windows-latest'
run: dotnet pack --verbosity normal -c Release --no-restore --include-source --version-suffix alpha.${{ github.run_number }} -o ./dist

- name: Upload Artifact
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: nupkgs
path: ./dist/*.*
Expand All @@ -54,12 +71,12 @@ jobs:
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: "6.0.x" # runners already have .Net Framework installed as well
dotnet-version: "8.0.x" # runners already have .Net Framework installed as well

- name: Pull interop dependencies
run: bash -c "build/download-native-libs.sh"
Expand All @@ -70,6 +87,7 @@ jobs:
echo "Version: $VERSION"
dotnet pack -c Release --include-source -p:Version=$VERSION -o ./dist src/PactNet/PactNet.csproj
dotnet pack -c Release --include-source -p:Version=$VERSION -o ./dist src/PactNet.Abstractions/PactNet.Abstractions.csproj
dotnet pack -c Release --include-source -o ./dist src/PactNet.Output.Xunit/PactNet.Output.Xunit.csproj
- name: Push
run: dotnet nuget push ./dist/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }}
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Triage Issue

on:
issues:
types:
- opened
- labeled
pull_request:
types:
- labeled

jobs:
call-workflow:
uses: pact-foundation/.github/.github/workflows/triage.yml@master
secrets: inherit
86 changes: 86 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
Contributing to PactNet
=======================

Raising Issues
--------------

Please don't raise issues for general queries (e.g. usage queries) and instead check the [Pact Docs] site or ask on the [Pact Foundation Slack].

Before raising any issues, please make as much effort as you can to rule out issues in your own environment as much as possible.
For example, if you are using a self-hosted Pact Broker instance and PactNet is failing to connect, please ensure things like the
authentication token and SSL certificate are valid.

If you are sure that the issye is with PactNet then please raise an issue, including as many of the following details as you can:

- PactNet version
- Your operating system and version
- .Net version
- Log output
- Steps to reproduce and/or a repository link which reproduces the issue
- Expected outcome
- Actual outcome

Due to the way that PactNet works, often issues that are found are not in PactNet itself but instead in the [pact-reference]
native FFI libraries. If this is the case then an upstream issue will be raised in the FFI repository and PactNet will have to
wait until the fix is available in a new FFI release.

Raising Pull Requests
---------------------

For new contributors it is recommended that you start a discussion with a core maintainer prior to raising a PR. This
is for your own benefit so that you don't waste time implementing changes which don't align with the project in general
or will require significant changes afterwards.

The best way to achieve this is to open an issue detailing:

- The problem you see at the moment
- The solution you propose to fix this problem (e.g. adding a new feature, refactoring an existing API, etc)
- Any downsides you can foresee as a result of this change

If an issue already exists for the change you wish to contribute, please comment on the existing issue.

After raising your PR, a core maintainer will review your change and may request/suggest changes. Please take the
feedback in the spirit intended so that the PR can be merged as quickly as possible whilst still meeting established
conventions within the project such as architecture, code style, test style/coverage and API evolution.

In particular it is much harder to make any changes which involve a breaking change, so please set expectations accordingly
if your change requires a new major version. A large and/or potentially disruptive change should typically take the form of
an RFC issue.

A good example of an RFC issue preceding a major change is [PR 457].

Building PactNet
----------------

In order to build PactNet you must first download the native Rust FFI libraries. You can pull the current supported
version by executing the script in Bash (or Git Bash on Windows):

```bash
build/download-native-libs.sh
```

Alternatively you can download a particular FFI version from the [pact-referece] releases or build your own version
locally, and then copy the artifacts into the folders:

```
build/
linux/
x86_64/
libpact_ffi.so
osx/
aarch64-apple-darwin/
libpact_ffi.dylib
x86_64/
libpact_ffi.dylib
windows/
x86_64/
pact_ffi.dll
```

After the native libraries are in the expected places then the solution can be built in your IDE or on the command
line using `dotnet build` as normal.

[pact-reference]: https://github.com/pact-foundation/pact-reference/releases
[Pact Docs]: https://docs.pact.io/
[Pact Foundation Slack]: https://pact-foundation.slack.com/
[PR 457]: https://github.com/pact-foundation/pact-net/issues/457
Loading

0 comments on commit 08561f9

Please sign in to comment.