Skip to content

Commit

Permalink
Merge pull request #58 from pact-foundation/feat/musl_static_win_aarch64
Browse files Browse the repository at this point in the history
feat: linux musl static bins / windows aarch64
  • Loading branch information
rholshausen authored May 6, 2024
2 parents 68a327a + ee3f7ad commit d4517df
Show file tree
Hide file tree
Showing 13 changed files with 373 additions and 141 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
operating-system: [ ubuntu-latest, windows-latest, macos-12 ]
env:
PACT_DO_NOT_TRACK: true
RUST_LOG: trace
Expand All @@ -24,17 +24,17 @@ jobs:
with:
toolchain: stable
- name: Install Protoc
uses: arduino/setup-protoc@v1
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install plugin cli
run: scripts/install-plugin-cli.sh
shell: bash
- name: Install Protobuf plugin
run: ~/bin/pact-plugin-cli -y install protobuf
run: ~/.pact/bin/pact-plugin-cli -y install protobuf
shell: bash
- name: Install csv plugin
run: ~/bin/pact-plugin-cli -y install csv
run: ~/.pact/bin/pact-plugin-cli -y install csv
shell: bash
- name: Install Pact verifier
run: scripts/install-verifier-cli.sh
Expand All @@ -51,8 +51,8 @@ jobs:
nohup ./target/debug/csv-provider &
PID=$!
trap "kill $PID" EXIT
pact_do_not_track=true ~/bin/pact_verifier_cli -f ../csv-consumer-rust/target/pacts/CsvClient-CsvServer.json -p 8080
pact_do_not_track=true ~/bin/pact_verifier_cli -f ../csv-consumer-jvm/build/pacts/CsvClient-CsvServer.json -p 8080
pact_do_not_track=true ~/.pact/bin/pact_verifier_cli -f ../csv-consumer-rust/target/pacts/CsvClient-CsvServer.json -p 8080
pact_do_not_track=true ~/.pact/bin/pact_verifier_cli -f ../csv-consumer-jvm/build/pacts/CsvClient-CsvServer.json -p 8080
cd ../csv-provider-jvm
mkdir -p server/src/test/resources/pacts
cp ../csv-consumer-jvm/build/pacts/CsvClient-CsvServer.json server/src/test/resources/pacts
Expand All @@ -70,7 +70,7 @@ jobs:
nohup ./target/debug/csv-provider &
PID=$!
trap "kill $PID" EXIT
pact_do_not_track=true ~/bin/pact_verifier_cli -f ../csv-consumer-jvm/build/pacts/CsvClient-CsvServer.json -p 8080
pact_do_not_track=true ~/.pact/bin/pact_verifier_cli -f ../csv-consumer-jvm/build/pacts/CsvClient-CsvServer.json -p 8080
shell: bash
working-directory: examples/csv
if: runner.os == 'Windows'
Expand All @@ -84,7 +84,7 @@ jobs:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
operating-system: [ ubuntu-latest, windows-latest, macos-12 ]
env:
PACT_DO_NOT_TRACK: true
RUST_LOG: trace
Expand All @@ -99,7 +99,7 @@ jobs:
with:
toolchain: stable
- name: Install Protoc
uses: arduino/setup-protoc@v1
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Go
Expand All @@ -110,7 +110,7 @@ jobs:
run: scripts/install-plugin-cli.sh
shell: bash
- name: Install Protobuf plugin
run: ~/bin/pact-plugin-cli -y install protobuf
run: ~/.pact/bin/pact-plugin-cli -y install protobuf
shell: bash
- name: Install Pact verifier
run: scripts/install-verifier-cli.sh
Expand Down Expand Up @@ -138,8 +138,8 @@ jobs:
PID=$!
trap "kill $PID" EXIT
timeout --foreground -s TERM 30s bash -c 'while [[ "$(curl -s -o /dev/null -m 3 -L -w ''%{http_code}'' -XPOST -d'{}' http://127.0.0.1:8111)" != "200" ]]; do echo "Waiting for http://127.0.0.1:8111" && sleep 2; done'
pact_do_not_track=true ~/bin/pact_verifier_cli -f ../protobuf-consumer-rust/target/pacts/protobuf-consumer-rust-protobuf-provider.json -p 8111
pact_do_not_track=true ~/bin/pact_verifier_cli -f ../protobuf-consumer-jvm/build/pacts/protobuf-consumer-protobuf-provider.json -p 8111
pact_do_not_track=true ~/.pact/bin/pact_verifier_cli -f ../protobuf-consumer-rust/target/pacts/protobuf-consumer-rust-protobuf-provider.json -p 8111
pact_do_not_track=true ~/.pact/bin/pact_verifier_cli -f ../protobuf-consumer-jvm/build/pacts/protobuf-consumer-protobuf-provider.json -p 8111
shell: bash
working-directory: examples/protobuf
if: runner.os == 'Linux'
Expand All @@ -158,8 +158,8 @@ jobs:
PID=$!
trap "kill $PID" EXIT
timeout --foreground -s TERM 30s bash -c 'while [[ "$(curl -s -o /dev/null -m 3 -L -w ''%{http_code}'' -XPOST -d'{}' http://127.0.0.1:8111)" != "200" ]]; do echo "Waiting for http://127.0.0.1:8111" && sleep 2; done'
pact_do_not_track=true ~/bin/pact_verifier_cli -f ../protobuf-consumer-rust/target/pacts/protobuf-consumer-rust-protobuf-provider.json -p 8111
pact_do_not_track=true ~/bin/pact_verifier_cli -f ../protobuf-consumer-jvm/build/pacts/protobuf-consumer-protobuf-provider.json -p 8111
pact_do_not_track=true ~/.pact/bin/pact_verifier_cli -f ../protobuf-consumer-rust/target/pacts/protobuf-consumer-rust-protobuf-provider.json -p 8111
pact_do_not_track=true ~/.pact/bin/pact_verifier_cli -f ../protobuf-consumer-jvm/build/pacts/protobuf-consumer-protobuf-provider.json -p 8111
shell: bash
working-directory: examples/protobuf
if: runner.os != 'Linux'
Expand All @@ -173,7 +173,7 @@ jobs:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
operating-system: [ ubuntu-latest, windows-latest, macos-12 ]
env:
PACT_DO_NOT_TRACK: true
RUST_LOG: trace
Expand All @@ -188,7 +188,7 @@ jobs:
with:
toolchain: stable
- name: Install Protoc
uses: arduino/setup-protoc@v1
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Go
Expand All @@ -199,7 +199,7 @@ jobs:
run: scripts/install-plugin-cli.sh
shell: bash
- name: Install Protobuf plugin
run: ~/bin/pact-plugin-cli -y install protobuf
run: ~/.pact/bin/pact-plugin-cli -y install protobuf
shell: bash
- name: Install Pact verifier
run: scripts/install-verifier-cli.sh
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
operating-system: [ ubuntu-latest, windows-latest, macos-12 ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK 19
Expand All @@ -18,7 +18,7 @@ jobs:
distribution: 'temurin'
java-version: 19
- name: Install Protoc
uses: arduino/setup-protoc@v1
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build plugin driver
Expand All @@ -28,7 +28,7 @@ jobs:
run: scripts/install-plugin-cli.sh
shell: bash
- name: Install Protobuf plugin
run: ~/bin/pact-plugin-cli -y install protobuf
run: ~/.pact/bin/pact-plugin-cli -y install protobuf
shell: bash
- name: Run plugin driver tests
run: ./gradlew -s --no-daemon -i check
Expand All @@ -51,7 +51,7 @@ jobs:
distribution: 'temurin'
java-version: ${{ matrix.jdk }}
- name: Install Protoc
uses: arduino/setup-protoc@v1
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build plugin driver
Expand All @@ -61,7 +61,7 @@ jobs:
run: scripts/install-plugin-cli.sh
shell: bash
- name: Install Protobuf plugin
run: ~/bin/pact-plugin-cli -y install protobuf
run: ~/.pact/bin/pact-plugin-cli -y install protobuf
shell: bash
- name: Run plugin driver tests
run: ./gradlew -s --no-daemon -i check
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/plugin-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ jobs:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
operating-system: [ ubuntu-latest, windows-latest, macos-12 ]
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
- name: Install Protoc
uses: arduino/setup-protoc@v1
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build plugin CLI
Expand Down
79 changes: 58 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,88 @@ on:
release:
types: [published]

pull_request:
branches:
- main
push:
branches:
- feat/musl_built_binaries

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true

jobs:
build-release:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
include:
- operating-system: ubuntu-20.04
targets: x86_64-unknown-linux-gnu,x86_64-unknown-linux-musl,aarch64-unknown-linux-gnu,aarch64-unknown-linux-musl
- operating-system: windows-2019
targets: aarch64-pc-windows-msvc,x86_64-pc-windows-msvc
- operating-system: macos-12
targets: aarch64-apple-darwin,x86_64-apple-darwin
fail-fast: false
env:
pact_do_not_track: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install stable Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
target: aarch64-apple-darwin
targets: ${{ matrix.targets }}

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

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
if: runner.os == 'Linux'
uses: docker/setup-buildx-action@v3

- name: Install LLVM
run: choco install -y llvm
if: runner.os == 'Windows'
- name: Install Protoc
uses: arduino/setup-protoc@v1
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- if: startsWith(github.ref, 'refs/tags/csv-plugin')
run: ./release.sh ${{ runner.os }}
- name: Cargo flags
id: cargo-flags
shell: bash
run: |
if [[ "${{ github.event_name }}" = "release" ]]; then
echo "flags=--release" >> "$GITHUB_OUTPUT"
else
echo "flags=" >> "$GITHUB_OUTPUT"
fi
- if: |
github.event_name == 'push' ||
github.event_name == 'pull_request' ||
startsWith(github.ref, 'refs/tags/csv-plugin')
run: ./release.sh ${{ runner.os }} ${{ steps.cargo-flags.outputs.flags }}
shell: bash
working-directory: plugins/csv
- name: Upload Release Assets
if: startsWith(github.ref, 'refs/tags/csv-plugin')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: plugins/csv/target/artifacts/*
file_glob: true
tag: ${{ github.ref }}
- if: startsWith(github.ref, 'refs/tags/pact-plugin-cli')
run: ./release.sh ${{ runner.os }}
- if: |
github.event_name == 'push' ||
github.event_name == 'pull_request' ||
startsWith(github.ref, 'refs/tags/pact-plugin-cli')
run: ./release.sh ${{ runner.os }} ${{ steps.cargo-flags.outputs.flags }}
shell: bash
working-directory: cli
- name: Upload Release Assets
if: startsWith(github.ref, 'refs/tags/pact-plugin-cli')
if: |
startsWith(github.ref, 'refs/tags/pact-plugin-cli') ||
startsWith(github.ref, 'refs/tags/csv-plugin')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: cli/target/artifacts/*
file: release_artifacts/*
file_glob: true
tag: ${{ github.ref }}
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
operating-system: [ ubuntu-latest, windows-latest, macos-12 ]
env:
pact_do_not_track: true
steps:
Expand All @@ -17,17 +17,17 @@ jobs:
toolchain: stable
components: clippy
- name: Install Protoc
uses: arduino/setup-protoc@v1
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install plugin cli
run: scripts/install-plugin-cli.sh
shell: bash
- name: Install Protobuf plugin
run: ~/bin/pact-plugin-cli -y install protobuf
run: ~/.pact/bin/pact-plugin-cli -y install protobuf
shell: bash
- name: Install csv plugin
run: ~/bin/pact-plugin-cli -y install csv
run: ~/.pact/bin/pact-plugin-cli -y install csv
shell: bash
- name: Tests
run: cargo test
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ build
target
pacts
*.out
# Generated Release Artifacts
release_artifacts

# Misc

Expand Down
Loading

0 comments on commit d4517df

Please sign in to comment.