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 a4cbe30
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 30 deletions.
26 changes: 23 additions & 3 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 @@ -21,6 +27,7 @@ jobs:
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: "🤖 Unit tests"
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"
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"
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
12 changes: 8 additions & 4 deletions .github/workflows/tmpl_build_rust_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
cache-restore-key:
required: true
type: string
force-rebuild:
required: true
type: string

jobs:
buildRustBinaries:
Expand Down Expand Up @@ -44,17 +47,18 @@ 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"
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'
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
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
4 changes: 2 additions & 2 deletions Support/Scripts/Config/prepare_build_tools
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
set -euo pipefail

# "import"
sourc "${BASH_SOURCE[0]%/*}/../utils.sh"
source "${BASH_SOURCE[0]%/*}/../utils.sh"

brew update

Expand All @@ -32,7 +32,7 @@ function brew_install {
echo -e "🍺 Installing $YELLOW$tool$NOCOLOR via Homebrew..."
executeCommand "brew install $tool"
else
echo -e "👍 $LIGHT_BLUE$tool$NOCOLOR is already installed."
echo -e "🍻 $LIGHT_BLUE$tool$NOCOLOR is already installed."
fi
}

Expand Down
2 changes: 1 addition & 1 deletion Support/Scripts/release
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function github_create_release_for {
function github_create_pull_request_for_new_version {
local version_tag="$1"
local version_branch="$2"
local pr_message="Release: $version_tag ($REPO_OWNER/$RELEASE_REPO_NAME/releases/tag/$version_tag)"
local pr_message="Release: [$version_tag](https://github.com/$REPO_OWNER/$RELEASE_REPO_NAME/releases/tag/$version_tag)"
local dry_run=; dry_run=$([ "$DRY_RUN" = true ] && echo "--dry-run" || echo "")
local open_pr_cmd="gh pr create --draft --base main --head \"$version_branch\" $dry_run --title \"$version_tag\" --body \"$pr_message\" --repo $REPO_OWNER/$XCPRODUCT_NAME"

Expand Down

0 comments on commit a4cbe30

Please sign in to comment.