Skip to content
Merged
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
9 changes: 5 additions & 4 deletions .github/workflows/build-ffi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,23 @@ jobs:
build:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
rust: [ stable ]
env:
pact_do_not_track: true
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: rustc --version || true
shell: bash
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
toolchain: stable
- name: Install shared mime info DB
if: runner.os == 'macOS'
run: brew install shared-mime-info
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rustfmt
Expand Down
26 changes: 10 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,31 @@ jobs:
env:
pact_do_not_track: true
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
toolchain: stable
components: clippy
- name: Install shared mime info DB
if: runner.os == 'macOS'
run: brew install shared-mime-info
- name: Tests
uses: marcopolo/cargo@master # TODO: - use actions-rs/cargo@v1 when PR merged https://github.com/actions-rs/cargo/pull/59
with:
working-directory: rust
command: test
run: cargo test
working-directory: rust
env:
RUST_LOG: debug
RUST_BACKTRACE: 1
- name: Build Components
uses: marcopolo/cargo@master
with:
working-directory: rust
command: build
run: cargo build
working-directory: rust
- name: Clippy
if: runner.os == 'Linux'
uses: marcopolo/cargo@master
with:
working-directory: rust
command: clippy
run: cargo clippy
working-directory: rust

musl-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: |
docker run --rm --user "$(id -u)":"$(id -g)" -v $(pwd):/workspace -w /workspace/rust -t -e TZ=UTC pactfoundation/rust-musl-build ./scripts/ci-musl-build.sh
32 changes: 19 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,25 @@ jobs:
env:
pact_do_not_track: true
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install stable Rust toolchain
uses: actions-rs/toolchain@v1
if: runner.os == 'Linux'
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
target: aarch64-apple-darwin
- name: Install LLVM
run: choco install -y llvm
targets: aarch64-unknown-linux-gnu,x86_64-unknown-linux-musl
- name: Install stable Rust toolchain
if: runner.os == 'Windows'
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: aarch64-pc-windows-msvc,x86_64-pc-windows-msvc
- name: Install stable Rust toolchain
if: runner.os == 'MacOS'
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: aarch64-apple-darwin,x86_64-apple-darwin
- if: startsWith(github.ref, 'refs/tags/pact_mock_server_cli') && runner.os == 'Linux'
run: ./release-linux.sh
working-directory: rust/pact_mock_server_cli
Expand All @@ -46,9 +54,6 @@ jobs:
run: ./release-osx.sh
shell: bash
working-directory: rust/pact_verifier_cli
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- if: startsWith(github.ref, 'refs/tags/libpact_ffi') && runner.os == 'Linux'
run: ./release-linux.sh
working-directory: rust/pact_ffi
Expand All @@ -61,13 +66,14 @@ jobs:
shell: bash
working-directory: rust/pact_ffi
- name: Upload the artifacts
uses: actions/upload-artifact@v1
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: actions/[email protected]
with:
name: release-artifacts
path: rust/target/artifacts
- name: Upload Release Assets
id: upload-release-asset
uses: svenstaro/upload-release-action@v2
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/upload-release-action@2.5.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: rust/target/artifacts/*
Expand Down
2 changes: 1 addition & 1 deletion rust/pact_ffi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ set_source_files_properties(
add_custom_command(
OUTPUT ${CBINDGEN_HEADER_FILE}
COMMAND
rustup run nightly-2022-12-01
rustup run nightly
${CBINDGEN_EXECUTABLE}
--config ${CBINDGEN_CONFIG_FILE}
--crate ${CRATE_NAME}
Expand Down
6 changes: 3 additions & 3 deletions rust/pact_ffi/ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rustc --version
cargo install --force cbindgen
rm -rf ./include

rustup toolchain install nightly-2022-12-01
rustup toolchain install nightly

echo -------------------------------------
echo - Build library with CMake
Expand All @@ -22,11 +22,11 @@ cd ..
echo -------------------------------------
echo - Generate header with cbindgen
echo -------------------------------------
rustup run nightly-2022-12-01 cbindgen \
rustup run nightly cbindgen \
--config cbindgen.toml \
--crate pact_ffi \
--output include/pact.h
rustup run nightly-2022-12-01 cbindgen \
rustup run nightly cbindgen \
--config cbindgen-c++.toml \
--crate pact_ffi \
--output include/pact-c++.h
Expand Down
8 changes: 4 additions & 4 deletions rust/pact_ffi/release-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ gzip -c ../target/release/libpact_ffi.a > ../target/artifacts/libpact_ffi-linux-
openssl dgst -sha256 -r ../target/artifacts/libpact_ffi-linux-x86_64.a.gz > ../target/artifacts/libpact_ffi-linux-x86_64.a.gz.sha256

echo -- Generate the header files --
rustup toolchain install nightly-2022-12-01
rustup component add rustfmt --toolchain nightly-2022-12-01
rustup run nightly-2022-12-01 cbindgen \
rustup toolchain install nightly
rustup component add rustfmt --toolchain nightly
rustup run nightly cbindgen \
--config cbindgen.toml \
--crate pact_ffi \
--output include/pact.h
rustup run nightly-2022-12-01 cbindgen \
rustup run nightly cbindgen \
--config cbindgen-c++.toml \
--crate pact_ffi \
--output include/pact-cpp.h
Expand Down