Skip to content

Commit

Permalink
Merge pull request #33 from YOU54F/you54f_v0.4.18_plus_plugin_forks
Browse files Browse the repository at this point in the history
You54f v0.4.18 plus plugin forks
  • Loading branch information
YOU54F authored Feb 27, 2024
2 parents f9d46a9 + 477f467 commit 91b7b9a
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 27 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
rm -rf /usr/bin/perl.exe
- run: cpanm FFI::Platypus
- run: make get_pact_ffi
- run: make get_pact_plugins
# - run: make get_pact_plugins
- run: ls
- run: make perl
haskell:
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
with:
python-version: "3.10"
- run: make get_pact_ffi
- run: make get_pact_plugins
# - run: make get_pact_plugins
- run: ls
- run: make python_install_deps
- run: make python
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
php-version: 8.1
extensions: ffi
- run: make get_pact_ffi
- run: make get_pact_plugins
# - run: make get_pact_plugins
- run: ls
- run: make php
deno:
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- run: make get_pact_plugins
# - run: make get_pact_plugins
- run: make deno
bun:
timeout-minutes: 10
Expand All @@ -251,7 +251,7 @@ jobs:
echo "BUN_INSTALL=$HOME/.bun" >> $GITHUB_ENV
echo "$HOME/.bun/bin" >> $GITHUB_PATH
- run: make get_pact_ffi
- run: make get_pact_plugins
# - run: make get_pact_plugins
- run: make bun
zig:
timeout-minutes: 10
Expand Down Expand Up @@ -338,7 +338,7 @@ jobs:
branch: swift-5.7.1-release
tag: 5.7.1-RELEASE
- run: make get_pact_ffi
- run: make get_pact_plugins
# - run: make get_pact_plugins
- run: make swift
lua:
timeout-minutes: 10
Expand Down Expand Up @@ -402,7 +402,7 @@ jobs:
with:
args: install protoc
- run: make get_pact_ffi
- run: make get_pact_plugins
# - run: make get_pact_plugins
- run: make lua
# scala:
# timeout-minutes: 10
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_ffi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
PACT_FFI_VERSION:
description: Tag from https://github.com/you54f/pact-reference/releases for libpact_ffi
required: true
default: 0.4.5
default: 0.4.18
type: string

jobs:
Expand Down
2 changes: 1 addition & 1 deletion FFI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.5
0.4.18
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ get_plugin_cli:
./script/download-plugin-cli.sh

install_protobuf_plugin:
${HOME}/.pact/cli/plugin/pact-plugin-cli -y install https://github.com/pactflow/pact-protobuf-plugin/releases/latest
${HOME}/.pact/cli/plugin/pact-plugin-cli -y install https://github.com/you54f/pact-protobuf-plugin/releases/latest

haskell_hello_ffi:
ghc haskell/hello_ffi.hs ${pactffi_filename} -o haskell/hello_ffi_haskell
Expand Down
2 changes: 1 addition & 1 deletion bun/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ const PactTestGrpc = async() => {
console.log('pactffi_with_specification_res')
console.log(pactffi_with_specification_res)
// Start mock server
const pactffi_using_plugin_res = pactffi_using_plugin(pact, s2b("protobuf"), s2b("0.1.17"));
const pactffi_using_plugin_res = pactffi_using_plugin(pact, s2b("protobuf"), s2b("0.3.14"));
console.log('pactffi_using_plugin_res')
console.log(pactffi_using_plugin_res)
const pactffi_interaction_contents_res = pactffi_interaction_contents(message_pact, s2b('InteractionPart_Request'), s2b("application/grpc"), s2b(JSON.stringify(contents)));
Expand Down
8 changes: 4 additions & 4 deletions deno/downloadFfi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function downloadFile(src: string, dest: string) {
await resp.body.pipeTo(file.writable);
}

export const detectFfiDownloadForPlatform = (ffiVersion = "v0.4.5") => {
export const detectFfiDownloadForPlatform = (ffiVersion = "v0.4.18") => {
const platform = Deno.build.os + "-" + Deno.build.arch;
console.log(platform);
let filename;
Expand All @@ -50,13 +50,13 @@ export const detectFfiDownloadForPlatform = (ffiVersion = "v0.4.5") => {
`We do not have a binary for your platform ${platform}`;
break;
}
const ffiLibDownloadLocation = `https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-${ffiVersion}/${filename}`;
const ffiHeaderDownloadLocation = `https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-${ffiVersion}/pact.h`;
const ffiLibDownloadLocation = `https://github.com/you54f/pact-reference/releases/download/libpact_ffi-${ffiVersion}/${filename}`;
const ffiHeaderDownloadLocation = `https://github.com/you54f/pact-reference/releases/download/libpact_ffi-${ffiVersion}/pact.h`;
console.log(ffiLibDownloadLocation);
return { ffiLibDownloadLocation, ffiHeaderDownloadLocation };
};

export const downloadFfiForPlatform = async (ffiVersion = "v0.4.5") => {
export const downloadFfiForPlatform = async (ffiVersion = "v0.4.18") => {
const locs = detectFfiDownloadForPlatform(ffiVersion);
const libraryFilename =
Deno.build.os === "darwin"
Expand Down
2 changes: 1 addition & 1 deletion lua/hello_grpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ lib.pactffi_with_specification(pact, 5)


-- Start mock server
lib.pactffi_using_plugin(pact, 'protobuf', '0.1.17')
lib.pactffi_using_plugin(pact, 'protobuf', '0.3.14')
lib.pactffi_interaction_contents(message_pact, 0, 'application/grpc',contents)
mock_server_port = lib.pactffi_create_mock_server_for_transport(pact , '0.0.0.0',0,'grpc',ffi.cast("void *", 0))
lib.pactffi_log_message(appName, 'INFO', "Mock server started: "..mock_server_port)
Expand Down
2 changes: 1 addition & 1 deletion pacts/consumer-test-provider-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
}
},
"name": "protobuf",
"version": "0.1.17"
"version": "0.3.14"
},
{
"configuration": {},
Expand Down
2 changes: 1 addition & 1 deletion perl/hello_grpc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# Start mock server
pactffi_log_message('pact-perl-ffi', 'INFO', "using plugin");
$ffi->attach('pactffi_using_plugin', ['pact','string','string'] => 'int');
pactffi_using_plugin($pact, 'protobuf', '0.1.17');
pactffi_using_plugin($pact, 'protobuf', '0.3.14');
pactffi_log_message('pact-perl-ffi', 'INFO', "got plugin");
pactffi_log_message('pact-perl-ffi', 'INFO', "setting interaction contents");
$ffi->attach('pactffi_interaction_contents', ['message_pact','int','string','string'] => 'int');
Expand Down
4 changes: 2 additions & 2 deletions php/hello_grpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@

// Start mock server

$ffi->pactffi_using_plugin($pact, 'protobuf', '0.1.17');
$ffi->pactffi_using_plugin($pact, 'protobuf', '0.3.14');
$ffi->pactffi_interaction_contents($message_pact, 0, 'application/grpc', $contents);
$port = $ffi->pactffi_create_mock_server_for_transport($pact , '0.0.0.0',0,'grpc', null);

echo sprintf("Mock server port=%d\n", $port);

// This is where we would call our client, gRPC in this example plugin demo
// PHP gRPC is client only, so would need to use a provider from the following
// https://github.com/pact-foundation/pact-plugins/tree/main/examples/gRPC/area_calculator
// https://github.com/you54f/pact-plugins/tree/main/examples/gRPC/area_calculator
// TODO build out an area calculator PHP example
// https://grpc.io/docs/languages/php/

Expand Down
2 changes: 1 addition & 1 deletion python/cffi/hello_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@


# Start mock server
lib.pactffi_using_plugin(pact, b'protobuf', b'0.1.17')
lib.pactffi_using_plugin(pact, b'protobuf', b'0.3.14')
lib.pactffi_interaction_contents(message_pact, 0, b'application/grpc', ffi.new("char[]", json.dumps(contents).encode('ascii')))
mock_server_port = lib.pactffi_create_mock_server_for_transport(pact , b'0.0.0.0',0,b'grpc',ffi.cast("void *", 0))
print(f"Mock server started: {mock_server_port}")
Expand Down
2 changes: 1 addition & 1 deletion python/ctypes/download-ffi-only-os-dependant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require_binary gunzip

require_env_var FFI_VERSION

BASEURL=https://github.com/pact-foundation/pact-reference/releases/download
BASEURL=https://github.com/you54f/pact-reference/releases/download
FFI_DIR="${LIB_DIR}/../.."

function download_ffi_file {
Expand Down
2 changes: 1 addition & 1 deletion python/ctypes/download-plugin-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require_binary gunzip

require_env_var PLUGIN_CLI_VERSION

BASEURL=https://github.com/pact-foundation/pact-plugins/releases/download
BASEURL=https://github.com/you54f/pact-plugins/releases/download
PLUGIN_CLI_DIR="${HOME}/.pact/cli/plugin"

if [[ $(find "${PLUGIN_CLI_DIR}" -name "${PLUGIN_CLI_VERSION}*") ]]; then
Expand Down
2 changes: 1 addition & 1 deletion script/lib/download-ffi-only-os-dependant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require_binary gunzip

require_env_var FFI_VERSION

BASEURL=https://github.com/pact-foundation/pact-reference/releases/download
BASEURL=https://github.com/you54f/pact-reference/releases/download
FFI_DIR="${LIB_DIR}/../.."

function download_ffi_file {
Expand Down
2 changes: 1 addition & 1 deletion script/lib/download-plugin-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require_binary gunzip

require_env_var PLUGIN_CLI_VERSION

BASEURL=https://github.com/pact-foundation/pact-plugins/releases/download
BASEURL=https://github.com/you54f/pact-plugins/releases/download
PLUGIN_CLI_DIR="${HOME}/.pact/cli/plugin"

if [[ $(find "${PLUGIN_CLI_DIR}" -name "${PLUGIN_CLI_VERSION}*") ]]; then
Expand Down
2 changes: 1 addition & 1 deletion script/lib/export-binary-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)" # Figure out where the script is running
PROJECT_DIR="${LIB_DIR}"/../../
export FFI_VERSION=v$(cat $PROJECT_DIR/FFI_VERSION)
export PLUGIN_CLI_VERSION=v0.0.1
export PLUGIN_CLI_VERSION=v0.1.2
2 changes: 1 addition & 1 deletion swift/hello_grpc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pactffi_with_specification(pact!!, PactSpecification_V4)

// Start mock server
pactffi_log_message(app_name, "INFO", "using plugin")
pactffi_using_plugin(pact!!, "protobuf", "0.1.17")
pactffi_using_plugin(pact!!, "protobuf", "0.3.14")
pactffi_log_message(app_name, "INFO", "got plugin, setting interaction contents: \(contents!)")
pactffi_interaction_contents(message_pact!!, InteractionPart_Request, "application/grpc", contents!)
pactffi_log_message(app_name, "INFO", "set interaction contents")
Expand Down

0 comments on commit 91b7b9a

Please sign in to comment.