Skip to content

Commit

Permalink
feat(ci): test x-plat arm64/x86_64/x64 macOS/Linux/Win
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Apr 26, 2023
1 parent 5611b43 commit 41ab2ac
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 41 deletions.
46 changes: 46 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
BUILD_TEST_TASK_TEMPLATE: &BUILD_TEST_TASK_TEMPLATE
arch_check_script:
- uname -am
install_script: bundle install
build_script: bundle exec rake package
test_script: |
cd pkg
ls
tar xvf *$BINARY_OS-$BINARY_ARCH.tar.gz
./pact/bin/pact-broker --help
./pact/bin/pact-message --help
./pact/bin/pact-mock-service --help
./pact/bin/pact-plugin-cli --help
./pact/bin/pact-provider-verifier --help
./pact/bin/pact-stub-service --help
./pact/bin/pactflow --help
linux_arm64_task:
arm_container:
image: ubuntu:latest
architecture: arm64
env:
BINARY_OS: linux
BINARY_ARCH: arm64
PATH: "$HOME/.rbenv/bin:/root/.rbenv/shims:$PATH"
pre_req_script: |
apt update --yes && apt install --yes git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev zip
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
rbenv install 3.2.2
rbenv global 3.2.2
ruby --version
bundler --version
<< : *BUILD_TEST_TASK_TEMPLATE

macosx_arm64_task:
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-base:latest
env:
BINARY_OS: osx
BINARY_ARCH: arm64
pre_req_script:
- brew install ruby
- ruby --version
<< : *BUILD_TEST_TASK_TEMPLATE
60 changes: 27 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,20 @@ jobs:
- name: Build
run: bundle exec rake package
shell: bash
- name: Show standalone packages
run: ls pkg
shell: bash
- name: Upload standalone packages
uses: actions/upload-artifact@v3
with:
name: pkg
path: pkg
- name: test package
if: ${{ runner.os == 'Linux'}}
run: |
cd pkg
tar xvf *linux-x86_64.tar.gz
pact --help
pact-broker --help
pact-broker --help
pact-message --help
pact-mock-service --help
pact-plugin-cli --help
pact-provider-verifier --help
pact-stub-service --help
pactflow --help
test:
needs: [build]
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest","macos-latest","windows-latest"]
os: ["windows-latest","ubuntu-latest","macos-latest"]
runs-on: ${{ matrix.os }}
steps:
- name: Download all workflow run artifacts
Expand All @@ -52,6 +41,7 @@ jobs:
if: ${{ runner.os == 'MacOS'}}
run: |
cd pkg
ls
tar xvf *osx-x86_64.tar.gz
./pact/bin/pact
./pact/bin/pact --help
Expand All @@ -66,6 +56,7 @@ jobs:
if: ${{ runner.os == 'Linux'}}
run: |
cd pkg
ls
tar xvf *linux-x86_64.tar.gz
./pact/bin/pact
./pact/bin/pact --help
Expand All @@ -79,30 +70,33 @@ jobs:
- name: test x86_64 package
if: ${{ runner.os == 'Windows'}}
shell: bash
continue-on-error: true
run: |
cd pkg
tar -xf *windows-x86_64.zip
.\pact\bin\pact.bat --help
.\pact\bin\pact-broker.bat --help
.\pact\bin\pact-message.bat --help
.\pact\bin\pact-mock-service.bat --help
.\pact\bin\pact-plugin-cli.bat --help
.\pact\bin\pact-provider-verifier.bat --help
.\pact\bin\pact-stub-service.bat --help
.\pact\bin\pactflow.bat --help
ls
unzip *windows-x86_64.zip
.\\pact\\bin\\pact.bat --help
.\\pact\\bin\\pact-broker.bat --help
.\\pact\\bin\\pact-message.bat --help
.\\pact\\bin\\pact-mock-service.bat --help
.\\pact\\bin\\pact-plugin-cli.exe --help
.\\pact\\bin\\pact-provider-verifier.bat --help
.\\pact\\bin\\pact-stub-service.bat --help
.\\pact\\bin\\pactflow.bat --help
rm -rf pact
- name: test x86 package
# Note there is no pact-plugin-cli for x86, so it isnt included in the bundle
if: ${{ runner.os == 'Windows'}}
shell: bash
run: |
cd pkg
tar -xf *windows-x86.zip
.\pact\bin\pact.bat --help
.\pact\bin\pact-broker.bat --help
.\pact\bin\pact-message.bat --help
.\pact\bin\pact-mock-service.bat --help
.\pact\bin\pact-plugin-cli.bat --help
.\pact\bin\pact-provider-verifier.bat --help
.\pact\bin\pact-stub-service.bat --help
.\pact\bin\pactflow.bat --help
ls
unzip *windows-x86.zip
.\\pact\\bin\\pact.bat --help
.\\pact\\bin\\pact-broker.bat --help
.\\pact\\bin\\pact-message.bat --help
.\\pact\\bin\\pact-mock-service.bat --help
.\\pact\\bin\\pact-provider-verifier.bat --help
.\\pact\\bin\\pact-stub-service.bat --help
.\\pact\\bin\\pactflow.bat --help
rm -rf pact
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<a name="v1.92.0"></a>
### v1.92.0 (2022-11-23)


#### Features

* add the plugin CLI to the package ([0be3e5e](/../../commit/0be3e5e))


<a name="v1.90.0"></a>
### v1.90.0
(2022-08-16)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ GEM
faraday (>= 0.17.3, < 3)

PLATFORMS
arm64-darwin-22
ruby

DEPENDENCIES
bump (~> 0.5)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Creates a standalone pact command line executable using the ruby pact implementa

## Installation

See the [releases](https://github.com/you54f/pact-ruby-standalone/releases) page for installation instructions.
See the [releases](https://github.com/pact-foundation/pact-ruby-standalone/releases) page for installation instructions.

## Usage

Download the appropriate package for your operating system from the [releases](https://github.com/you54f/pact-ruby-standalone/releases) page and unzip it.
Download the appropriate package for your operating system from the [releases](https://github.com/pact-foundation/pact-ruby-standalone/releases) page and unzip it.

$ cd pact/bin
$ ./pact-mock-service --help start
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.91.0
1.92.0
10 changes: 7 additions & 3 deletions packaging/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ GEM
term-ansicolor (~> 1.7)
thor (>= 0.20, < 2.0)
parslet (2.0.0)
rack (2.2.6.4)
rack (2.2.7)
rack-proxy (0.7.6)
rack
rack-reverse-proxy (0.12.0)
Expand All @@ -99,9 +99,9 @@ GEM
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.1)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.2)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.5)
Expand All @@ -121,6 +121,10 @@ GEM
webrick (1.8.1)

PLATFORMS
aarch64-linux
arm64-darwin-20
arm64-darwin-21
arm64-darwin-22
ruby
x64-mingw32

Expand Down
2 changes: 1 addition & 1 deletion tasks/package.rake
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,4 @@ def install_plugin_cli(package_dir, package_target)
sh "gunzip -N -f #{package_dir}/bin/pact-plugin-cli.exe.gz"
sh "chmod +x #{package_dir}/bin/pact-plugin-cli.exe"
end
end
end

0 comments on commit 41ab2ac

Please sign in to comment.