Update target configuration and module #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
push: | |
branches: | |
- 'main' | |
- 'chore/**' | |
- 'docs/**' | |
- 'feat/**' | |
- 'feature/**' | |
- 'fix/**' | |
- 'refactor/**' | |
- 'releases/**' | |
- 'style/**' | |
- 'test/**' | |
- 'tech/**' | |
env: | |
RUST_TARGET_PATH: pact-reference/rust/target | |
BINARIES_PATH: Resources | |
jobs: | |
build: | |
name: "Build libpact_ffi binaries" | |
runs-on: macos-14-arm64 | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: true | |
concurrency: | |
group: build-macos14-arm64-${{ github.ref }} | |
cancel-in-progress: true | |
steps: | |
- name: "♻️ Checkout repository" | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: "♼ Cache rust binaries" | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ env.RUST_TARGET_PATH }} | |
${{ env.BINARIES_PATH }} | |
key: build-${{ runner.os }}-rust-${{ hashFiles('**/libpact_ffi.version') }} | |
restore-keys: | | |
build-${{ runner.os }}-rust- | |
- name: "🔍 Check if binaries exist in ${{ env.BINARIES_PATH }}" | |
id: check_files | |
uses: andstor/file-existence-action@v1 | |
with: | |
files: "Resources/**/libpact_ffi.a" | |
- name: "🎁 Build binaries (if not cached)" | |
if: steps.check_files.outputs.files_exist == 'false' | |
run: | | |
Support/build_rust_dependencies | |
testMacOS14: | |
name: "Test macOS 14 arm64" | |
runs-on: macos-14-arm64 | |
needs: [build] | |
concurrency: | |
group: test-${{ github.ref }}-${{ matrix.scheme }} | |
cancel-in-progress: true | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- scheme: "PactSwiftMockServer-iOS" | |
destination: "platform=iOS Simulator,name=iPhone 15 Pro" | |
- scheme: "PactSwiftMockServer-macOS" | |
destination: "arch=arm64" | |
env: | |
SCHEME: ${{ matrix.scheme }} | |
DESTINATION: ${{ matrix.destination }} | |
steps: | |
- name: "♻️ Checkout repository" | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: "♼ Cache rust binaries" | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ env.RUST_TARGET_PATH }} | |
${{ env.BINARIES_PATH }} | |
key: build14-${{ runner.os }}-rust-${{ hashFiles('**/libpact_ffi.version') }} | |
restore-keys: | | |
build14-${{ runner.os }}-rust- | |
- name: "🏗 Use Xcode 15.3" | |
run: sudo xcode-select -switch /Applications/Xcode_15.3.app | |
- name: "🛠 Prepare Tools" | |
run: | | |
sh Support/prepare_build_tools | |
- name: "⚗️ Run tests (Xcode)" | |
run: | | |
sh Support/build_test | |
testMacOS13: | |
name: "Test macOS 13" | |
runs-on: macos-13 | |
needs: [build] | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- scheme: "PactSwiftMockServer-iOS" | |
destination: "platform=iOS Simulator,name=iPhone 14 Pro" | |
- scheme: "PactSwiftMockServer-macOS" | |
destination: "arch=x86_64" | |
env: | |
SCHEME: ${{ matrix.scheme }} | |
DESTINATION: ${{ matrix.destination }} | |
concurrency: | |
group: test-${{ github.ref }}-${{ matrix.scheme }} | |
cancel-in-progress: true | |
steps: | |
- name: "♻️ Checkout repository" | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: "♼ Cache rust binaries" | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ env.RUST_TARGET_PATH }} | |
${{ env.BINARIES_PATH }} | |
key: build13-${{ runner.os }}-rust-${{ hashFiles('**/libpact_ffi.version') }} | |
restore-keys: | | |
build13-${{ runner.os }}-rust- | |
- name: "🏗 Use Xcode 15.2" | |
run: sudo xcode-select -switch /Applications/Xcode_15.2.app | |
- name: "🛠 Prepare Tools" | |
run: | | |
sh Support/prepare_build_tools | |
- name: "⚗️ Run tests (Xcode)" | |
run: | | |
sh Support/build_test | |
- name: "⬆️ Upload code coverage" | |
run: | | |
bash <(curl -s https://codecov.io/bash) -J 'PactSwiftMockServer' |