Skip to content

Commit

Permalink
Update the release PR message
Browse files Browse the repository at this point in the history
  • Loading branch information
surpher committed Dec 18, 2024
1 parent 2a046d4 commit d764525
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
run_on_merge:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: "📦 Checkout"
Expand Down
32 changes: 26 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: "🧑‍🔬 Build and Test"

on:
workflow_dispatch:
inputs:
force-rebuild:
required: false
default: false
type: boolean
description: "Re-build Rust binaries"
push:
branches:
- 'run-on-ci/**'
Expand All @@ -15,12 +21,13 @@ env:
jobs:
sharedInputs:
name: "👭 Shared envs"
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
rust-target-path: ${{ env.RUST_TARGET_PATH }}
binaries-path: ${{ env.BINARIES_PATH }}
cache-key: ${{ env.CACHE_KEY }}
cache-restore-key: ${{ env.CACHE_RESTORE_KEY }}
force-rebuild: ${{ inputs.force-rebuild }}

steps:
- run: echo "Just a hacky workaround for passing envs to jobs expecting them... ¯\_(ツ)_/¯"
Expand All @@ -34,24 +41,37 @@ jobs:
binaries-path: ${{ needs.sharedInputs.outputs.binaries-path }}
cache-key: ${{ needs.sharedInputs.outputs.cache-key }}
cache-restore-key: ${{ needs.sharedInputs.outputs.cache-restore-key }}
force-rebuild: "${{ needs.sharedInputs.outputs.force-rebuild }}"

testMacOS15:
name: "🤖 Test"
needs: [sharedInputs, buildFFI]
uses: ./.github/workflows/tmpl_test_macos15.yml
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
with:
rust-target-path: ${{ needs.sharedInputs.outputs.rust-target-path }}
binaries-path: ${{ needs.sharedInputs.outputs.binaries-path }}
cache-key: ${{ needs.sharedInputs.outputs.cache-key }}
cache-restore-key: ${{ needs.sharedInputs.outputs.cache-restore-key }}
submit-coverage-report: true

testMacOS14:
name: "🤖 Unit tests"
name: "🤖 Test"
needs: [sharedInputs, buildFFI]
uses: ./.github/workflows/tmpl_test_macos14_arm64.yml
uses: ./.github/workflows/tmpl_test_macos14.yml
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
with:
rust-target-path: ${{ needs.sharedInputs.outputs.rust-target-path }}
binaries-path: ${{ needs.sharedInputs.outputs.binaries-path }}
cache-key: ${{ needs.sharedInputs.outputs.cache-key }}
cache-restore-key: ${{ needs.sharedInputs.outputs.cache-restore-key }}
submit-coverage-report: false

testMacOS13:
name: "🤖 Unit tests"
name: "🤖 Test"
needs: [sharedInputs, buildFFI]
uses: ./.github/workflows/tmpl_test_macos13_x86_64.yml
uses: ./.github/workflows/tmpl_test_macos13.yml
with:
rust-target-path: ${{ needs.sharedInputs.outputs.rust-target-path }}
binaries-path: ${{ needs.sharedInputs.outputs.binaries-path }}
Expand Down
27 changes: 19 additions & 8 deletions .github/workflows/tmpl_build_rust_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ on:
cache-restore-key:
required: true
type: string
force-rebuild:
required: true
type: string

jobs:
buildRustBinaries:
name: "🏗️ Build libpact_ffi.a"
runs-on: macos-latest
runs-on: macos-15
timeout-minutes: 60
strategy:
fail-fast: true
Expand All @@ -34,7 +37,7 @@ jobs:
with:
submodules: recursive

- name: " Cache rust binaries"
- name: "🗂️ Cache rust binaries"
uses: actions/cache@v4
with:
path: |
Expand All @@ -44,17 +47,25 @@ jobs:
restore-keys: |
${{ inputs.cache-restore-key }}-${{ runner.os }}
- name: "🔍 Check binaries in ${{ inputs.binaries-path }}"
- name: "🔍 Check binaries exist in ${{ inputs.binaries-path }}"
id: check_files
uses: andstor/file-existence-action@v3
with:
files: "Resources/**/libpact_ffi.a"

- name: "🛠 Prepare Tools"
- name: "🛠 Prepare Tools"
if: ${{ steps.check_files.outputs.files_exists == 'false' || inputs.force-rebuild == 'true' }}
run: |
sh Support/Scripts/prepare_build_tools
sh Support/Scripts/Config/prepare_build_tools
- name: "🎁 Build FFI binaries (skipping if cached)"
if: steps.check_files.outputs.files_exists == 'false'
- name: "🎁 Build FFI binaries (skipping if cached)"
if: ${{ steps.check_files.outputs.files_exists == 'false' || inputs.force-rebuild == 'true' }}
run: |
sh Support/Scripts/build_rust_dependencies
sh Support/Scripts/CI/build_rust_dependencies
- name: "🚚 Upload binaries"
if: ${{ steps.check_files.outputs.files_exists == 'false' || inputs.force-rebuild == 'true' }}
uses: actions/upload-artifact@v4
with:
name: Resources
path: Resources
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "On macOS 13 (intel)"
name: "macOS 13"

on:
workflow_call:
Expand All @@ -15,12 +15,13 @@ on:
cache-restore-key:
required: true
type: string

env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer

jobs:
testMacOS13:
name: "⚗️ macOS 13 (Intel)"
name: "🖥️ macOS 13"
runs-on: macos-13

strategy:
Expand All @@ -30,14 +31,14 @@ jobs:
- scheme: "PactSwiftMockServer-iOS"
destination: "platform=iOS Simulator,name=iPhone 14 Pro"
- scheme: "PactSwiftMockServer-macOS"
destination: "arch=x86_64"
destination: "" # Intentionally left empty

env:
SCHEME: ${{ matrix.scheme }}
DESTINATION: ${{ matrix.destination }}

concurrency:
group: test-macos13_x86_64-${{ github.ref }}-${{ matrix.scheme }}
group: test-macos13-${{ github.ref }}-${{ matrix.scheme }}
cancel-in-progress: true

steps:
Expand All @@ -56,10 +57,7 @@ jobs:
restore-keys: |
${{ inputs.cache-restore-key }}-${{ runner.os }}
- name: "🛠 Prepare Tools"
run: |
sh Support/Scripts/Config/prepare_build_tools
- name: "⚗️ Run tests"
run: |
sh Support/Scripts/Config/prepare_build_tools
sh Support/Scripts/test
69 changes: 69 additions & 0 deletions .github/workflows/tmpl_test_macos14.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: "macOS 14"

on:
workflow_call:
inputs:
rust-target-path:
required: true
type: string
binaries-path:
required: true
type: string
cache-key:
required: true
type: string
cache-restore-key:
required: true
type: string
secrets:
codecov_token:
required: true

env:
DEVELOPER_DIR: /Applications/Xcode_16.0.app/Contents/Developer

jobs:
testMacOS14:
name: "🖥️ macOS 14"
runs-on: macos-14

strategy:
fail-fast: true
matrix:
include:
- scheme: "PactSwiftMockServer-iOS"
destination: "platform=iOS Simulator,name=iPhone 15 Pro"
- scheme: "PactSwiftMockServer-macOS"
destination: "" # Intentionally left empty

env:
SCHEME: ${{ matrix.scheme }}
DESTINATION: ${{ matrix.destination }}

concurrency:
group: test-macos14-${{ github.ref }}-${{ matrix.scheme }}
cancel-in-progress: true

steps:
- name: "♻️ Checkout repository"
uses: actions/checkout@v4
with:
submodules: recursive

- name: "♼ Cache rust binaries"
uses: actions/cache@v4
with:
path: |
${{ inputs.rust-target-path }}
${{ inputs.binaries-path }}
key: ${{ inputs.cache-restore-key }}-${{ runner.os }}-${{ hashFiles('**/libpact_ffi.version') }}
restore-keys: |
${{ inputs.cache-restore-key }}-${{ runner.os }}
- name: "🛠 Prepare Tools"
run: |
sh Support/Scripts/Config/prepare_build_tools
- name: "⚗️ Run tests"
run: |
sh Support/Scripts/test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "On macOS 14 (latest)"
name: "macOS 14"

on:
workflow_call:
Expand All @@ -21,33 +21,32 @@ on:
secrets:
codecov_token:
required: true
workflow_dispatch:

env:
DEVELOPER_DIR: /Applications/Xcode_15.3.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer

jobs:
testMacOS14:
name: "⚗️ macOS (latest)"
runs-on: macos-latest
name: "🖥️ macOS 15"
runs-on: macos-15

strategy:
fail-fast: true
matrix:
include:
- scheme: "PactSwiftMockServer-iOS"
destination: "platform=iOS Simulator,name=iPhone 15 Pro"
destination: "platform=iOS Simulator,name=iPhone 16 Pro"
submit_code_coverage: true
- scheme: "PactSwiftMockServer-macOS"
destination: "arch=arm64"
submit_code_coverage: true
destination: "" # Intentionally left empty
submit_code_coverage: false

env:
SCHEME: ${{ matrix.scheme }}
DESTINATION: ${{ matrix.destination }}

concurrency:
group: test-macos14-latest-${{ github.ref }}-${{ matrix.scheme }}
group: test-macos15-${{ github.ref }}-${{ matrix.scheme }}
cancel-in-progress: true

steps:
Expand All @@ -66,10 +65,13 @@ jobs:
restore-keys: |
${{ inputs.cache-restore-key }}-${{ runner.os }}
- name: "⚗️ Run tests"
- name: "🛠 Prepare Tools"
run: |
sh Support/Scripts/Config/prepare_build_tools
sh Support/Scrips/test
- name: "⚗️ Run tests"
run: |
sh Support/Scripts/test
- name: "⬆️ Upload coverage reports"
if: ${{ matrix.submit_code_coverage && inputs.submit-coverage-report }}
Expand Down
12 changes: 6 additions & 6 deletions Support/Scripts/CI/build_rust_dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ elif command -v ~/.cargo/bin/cargo &> /dev/null; then
echo "👍 cargo installed in ~/.cargo/bin/"
else
echo "🚨 Rust/Cargo not installed"
echo -e "ERROR: 'cargo' is a required dependency.\nInstall Rust using either homebrew or follow instructions at https://www.rust-lang.org/tools/install"
echo -e "error: 'cargo' is a required dependency.\nInstall Rust using either homebrew or follow instructions at https://www.rust-lang.org/tools/install"
exit 1
fi

Expand All @@ -67,7 +67,7 @@ fi

# Update pact-reference submodule
echo "🔃 Updating pact-reference submodule"
executeCommand "git submodule update --init"
executeCommand "git submodule update --remote --recursive"

echo "ℹ️ Changing location to ${LIBPACT_FFI_DIR}"
executeCommand "cd $LIBPACT_FFI_DIR"
Expand Down Expand Up @@ -120,7 +120,7 @@ executeCommand "cargo build --target=aarch64-apple-darwin --release"
echo "🏗 Building libpact_ffi.a for arm64 iOS device"
executeCommand "cargo build --target=aarch64-apple-ios --release"

echo "✅ libpact_ffi.a binaries built"
echo -e "${GREEN}libpact_ffi.a binaries built$NOCOLOR"

echo "🏗 Building pact_ffi.h..."
executeCommand "mkdir -p build && cd build"
Expand All @@ -140,23 +140,23 @@ echo "🏗 Copying binaries from ${PWD} to ${WORKSPACE}/Resources"
# Copy binary for an iOS device
echo "🚚 Copying arm64-ios (iOS device) binary..."
executeCommand "cp ../target/aarch64-apple-ios/release/libpact_ffi.a $WORKSPACE/Resources/iOS-device/libpact_ffi.a"
echo "👍 Copied arm64-ios binary."
echo -e "${GREEN}👍 Copied arm64-ios binary.$NOCOLOR"

# Create a fat binary for iOS Simulators and copy to workspace
echo "🚚 Creating a fat binary for iOS Simulator (x86_64 and arm64)..."
executeCommand "lipo -create \
../target/x86_64-apple-ios/release/libpact_ffi.a \
../target/aarch64-apple-ios-sim/release/libpact_ffi.a \
-output $WORKSPACE/Resources/iOS-simulator/libpact_ffi.a"
echo "👍 Copied x86_64-ios and arm64-ios-sim fattie."
echo -e "${GREEN}👍 Copied x86_64-ios and arm64-ios-sim fattie.$NOCOLOR"

# Create a fat darwin binary and copy to workspace
echo "🚚 Copying x86_64-darwin and arm64-darwin into a fat binary..."
executeCommand "lipo -create \
../target/x86_64-apple-darwin/release/libpact_ffi.a \
../target/aarch64-apple-darwin/release/libpact_ffi.a \
-output $WORKSPACE/Resources/x86_64-darwin/libpact_ffi.a"
echo "👍 Copied x86_64-darwin and arm64-darwin fattie."
echo -e "👍 ${GREEN}Copied x86_64-darwin and arm64-darwin fattie.$NOCOLOR"

echo "🏗 Copying pact_ffi.h from ${PWD}/include to ${WORKSPACE}/Sources"
executeCommand "cp include/pact_ffi.h ${WORKSPACE}/Sources"
Expand Down
4 changes: 2 additions & 2 deletions Support/Scripts/Config/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ MIN_XCODE_VERSION="16.1"
XCODE_VERSION_MIN_SUGGESTED="16.1"
XCODE_VERSION_MIN_SUPPORTED="16.0"

IPHONEOS_DEPLOYMENT_TARGET=16.0
MACOSX_DEPLOYMENT_TARGET=13.0
IPHONEOS_DEPLOYMENT_TARGET=13.0
MACOSX_DEPLOYMENT_TARGET=12.0

LIBPACT_FFI_VERSION_FILE="libpact_ffi.version"

Expand Down
Loading

0 comments on commit d764525

Please sign in to comment.