Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add all current buildable targets #276

Closed
wants to merge 2 commits into from
Closed
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
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Release workflow

on:
release:
types: [published]
workflow_dispatch:
# release:
# types: [published]

jobs:
build-release:
Expand Down
234 changes: 234 additions & 0 deletions .github/workflows/x-plat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
name: Cross - FFI / Mock Server / Verifier

on:
push:
release:
types: [published]

jobs:

setup_matrix:
runs-on: ubuntu-latest
outputs:
crate: ${{ steps.generate_matrix.outputs.crate }}
steps:
- name: Generate Matrix for testing
id: generate_matrix
run: |
if [[ ${{ github.ref }} == *"libpact_ffi"* ]]; then
crate_to_test=[\"pact_ffi\"]
elif [[ ${{ github.ref }} == *"pact_verifier_cli"* ]]; then
crate_to_test=[\"pact_verifier_cli\"]
elif [[ ${{ github.ref }} == *"pact_mock_server_cli"* ]]; then
crate_to_test=[\"pact_mock_server_cli\"]
else
crate_to_test=[\"pact_verifier_cli\",\"pact_mock_server_cli\",\"pact_ffi\"]
fi
CRATE=$crate_to_test
echo "crate=${CRATE}" >> "$GITHUB_OUTPUT"
- run: echo "${{ toJson(steps.generate_matrix.outputs.crate) }}"
name: Testing ${{ toJson(steps.generate_matrix.outputs.crate) }}

cross:
runs-on: ${{ matrix.os }}
needs: setup_matrix
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
crate: ${{ fromJson(needs.setup_matrix.outputs.crate) }}
target: # https://github.com/cross-rs/cross/blob/main/targets.toml
# βœ… These all build with cross
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- arm-unknown-linux-gnueabi
- arm-unknown-linux-gnueabihf
- arm-unknown-linux-musleabi
- arm-unknown-linux-musleabihf
- armv7-unknown-linux-gnueabi
- armv7-unknown-linux-gnueabihf
- armv7-unknown-linux-musleabi
- armv7-unknown-linux-musleabihf
- i586-unknown-linux-gnu
- i686-unknown-linux-gnu
- x86_64-unknown-netbsd
- x86_64-unknown-freebsd
- armv5te-unknown-linux-gnueabi
- armv5te-unknown-linux-musleabi
- arm-linux-androideabi
- armv7-linux-androideabi
- aarch64-linux-android
- i686-linux-android
- x86_64-linux-android
- thumbv7neon-linux-androideabi
- thumbv7neon-unknown-linux-gnueabihf
- i686-pc-windows-gnu
steps:
- uses: actions/checkout@v3
- run: rustc --version || true
shell: bash
- uses: dtolnay/rust-toolchain@stable
continue-on-error: true
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Build ${{ matrix.crate }} with cross for ${{ matrix.target }}
run: ../scripts/build-cross.sh
working-directory: rust/${{ matrix.crate }}
shell: bash
env:
target: ${{ matrix.target }}
- name: Show ${{ matrix.crate }} release
run: ls && ls ../../artifacts
working-directory: rust/target/${{ matrix.target }}/release
shell: bash
- name: Upload the artifacts
uses: actions/[email protected]
with:
name: release-artifacts
path: rust/target/artifacts
- name: Upload Release Assets
if: (startsWith(github.ref, 'refs/tags/libpact_ffi') || startsWith(github.ref, 'refs/tags/pact_verifier_cli') || startsWith(github.ref, 'refs/tags/pact_mock_server_cli'))
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: rust/target/artifacts/*
file_glob: true
tag: ${{ github.ref }}

windows:
runs-on: ${{ matrix.os }}
needs: setup_matrix
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [windows-latest]
crate: ${{ fromJson(needs.setup_matrix.outputs.crate) }}
target:
- x86_64-pc-windows-msvc # βœ…
- aarch64-pc-windows-msvc # βœ…
- i686-pc-windows-msvc # βœ…
- x86_64-pc-windows-gnu # βœ…
steps:
- uses: actions/checkout@v3
- run: rustc --version || true
shell: bash
- uses: dtolnay/rust-toolchain@stable
continue-on-error: true
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Build ${{ matrix.crate }} with cross for ${{ matrix.target }}
run: ../scripts/build-cross.sh
working-directory: rust/${{ matrix.crate }}
shell: bash
env:
target: ${{ matrix.target }}
- name: Show ${{ matrix.crate }} release
run: ls && ls ../../artifacts
working-directory: rust/target/${{ matrix.target }}/release
shell: bash
- name: Upload the artifacts
uses: actions/[email protected]
with:
name: release-artifacts
path: rust/target/artifacts
- name: Upload Release Assets
if: (startsWith(github.ref, 'refs/tags/libpact_ffi') || startsWith(github.ref, 'refs/tags/pact_verifier_cli') || startsWith(github.ref, 'refs/tags/pact_mock_server_cli'))
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: rust/target/artifacts/*
file_glob: true
tag: ${{ github.ref }}

macos:
runs-on: ${{ matrix.os }}
needs: setup_matrix
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
crate: ${{ fromJson(needs.setup_matrix.outputs.crate) }}
os: [macos-latest]
target:
- aarch64-apple-darwin # βœ…
- x86_64-apple-darwin # βœ…
- aarch64-apple-ios # βœ…
- aarch64-apple-ios-sim # βœ…
- x86_64-apple-ios # βœ…
steps:
- uses: actions/checkout@v3
- run: rustc --version || true
shell: bash
- uses: dtolnay/rust-toolchain@stable
continue-on-error: true
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Build ${{ matrix.crate }} with cross for ${{ matrix.target }}
run: ../scripts/build-cross.sh
working-directory: rust/${{ matrix.crate }}
shell: bash
env:
target: ${{ matrix.target }}
- name: Show ${{ matrix.crate }} release
run: ls && ls ../../artifacts
working-directory: rust/target/${{ matrix.target }}/release
shell: bash
- name: Upload the artifacts
uses: actions/[email protected]
with:
name: release-artifacts
path: rust/target/artifacts
- name: Upload Release Assets
if: (startsWith(github.ref, 'refs/tags/libpact_ffi') || startsWith(github.ref, 'refs/tags/pact_verifier_cli') || startsWith(github.ref, 'refs/tags/pact_mock_server_cli'))
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: rust/target/artifacts/*
file_glob: true
tag: ${{ github.ref }}


build_headers:
if: ${{ fromJson(needs.setup_matrix.outputs.crate) }} == [\"pact_ffi\"]
runs-on: ${{ matrix.operating-system }}
needs: setup_matrix
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- run: rustc --version || true
shell: bash
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Build headers with cargo pact_ffi
run: ./build-headers.sh
working-directory: rust/pact_ffi
shell: bash
- name: Upload the artifacts
uses: actions/[email protected]
with:
name: release-artifacts
path: rust/target/artifacts
- name: Upload Release Assets
if: startsWith(github.ref, 'refs/tags/libpact_ffi')
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: rust/target/artifacts/*
file_glob: true
tag: ${{ github.ref }}
Loading