Skip to content

Commit

Permalink
Remove support for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
surpher committed Aug 5, 2023
1 parent 92b45ae commit b2998d4
Show file tree
Hide file tree
Showing 52 changed files with 297 additions and 788 deletions.
136 changes: 50 additions & 86 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,135 +4,99 @@ on:
push:
branches:
- 'main'
- 'chore/**'
- 'docs/**'
- 'feat/**'
- 'feature/**'
- 'fix/**'
- 'refactor/**'
- 'releases/**'
- 'style/**'
- 'test/**'
- 'tech/**'

env:
RUST_TARGET_PATH: pact-reference

jobs:
test:
name: Run ${{ matrix.platform }} on ${{ matrix.host }}
test_ios:
name: "🤖 Test iOS"
runs-on: ${{ matrix.host }}

strategy:
fail-fast: true
matrix:
host: [macos-11, macos-12]
platform: [ios, macos]
host: [macos-12, macos-13]
include:
- platform: ios
scheme: "PactSwift-iOS"
destination: "platform=iOS Simulator,name=iPhone 12 Pro"
- platform: macos
scheme: "PactSwift-macOS"
destination: "arch=x86_64"
- host: macos-11
xcode: 13.2.1
- host: macos-13
destination: "platform=iOS Simulator,name=iPhone 14 Pro"
xcode: '15.0'
- host: macos-12
xcode: 14.0.1
destination: "platform=iOS Simulator,name=iPhone 12 Pro"
xcode: 14.1

env:
SCHEME: ${{ matrix.scheme }}
SCHEME: "PactSwift-iOS"
DESTINATION: ${{ matrix.destination }}

concurrency:
group: test_${{ matrix.host }}_${{ matrix.scheme }}_${{ github.ref }}
group: test_${{ matrix.host }}_${{ matrix.xcode }}_iOS_${{ github.ref }}
cancel-in-progress: true

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: "🧑‍💻 Checkout repository"
uses: actions/checkout@v3

- name: Use Xcode ${{ matrix.xcode }}
- name: "🏭 Use Xcode ${{ matrix.xcode }}"
run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app

- name: Prepare Tools
- name: "🧰 Prepare tools"
run: |
Scripts/prepare_build_tools
- name: Run tests (Xcode)
- name: "🧪 Run tests (xcodebuild)"
run: |
set -o pipefail && xcodebuild clean test -project PactSwift.xcodeproj -scheme "$SCHEME" -destination "$DESTINATION" GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcbeautify
set -o pipefail && xcodebuild -resolvePackageDependencies && xcodebuild clean test -project PactSwift.xcodeproj -scheme "$SCHEME" -destination "$DESTINATION" GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcbeautify
- name: Run tests (CLI - Swift Package)
- name: "⚗️ Run tests (swift)"
run: |
swift build
swift test -c release
test_linux:
name: Run on Ubuntu
runs-on: ubuntu-latest
set -o pipefail && swift test -c release
test_macos:
name: "🤖 Test macOS"
runs-on: ${{ matrix.host }}

strategy:
fail-fast: true
matrix:
host: [macos-12, macos-13]
include:
- host: macos-13
xcode: '15.0'
- host: macos-12
xcode: 14.1

env:
SCHEME: "PactSwift-macOS"
DESTINATION: "arch=x86_64"

concurrency:
group: test-linux-${{ github.ref }}
group: test_${{ matrix.host }}_${{ matrix.xcode }}_macOS_${{ github.ref }}
cancel-in-progress: true

steps:
- uses: fwal/setup-swift@v1
- name: Get swift version
run: swift --version

- name: "⬇️ Checkout repository"
uses: actions/checkout@v2

- name: Install Protoc
uses: arduino/setup-protoc@v1

- name: "♼ Cache rust binaries"
uses: actions/cache@v3
with:
path: |
${{ env.RUST_TARGET_PATH }}
key: build-${{ runner.os }}-rust-pactswift-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
build-${{ runner.os }}-rust-pactswift
build-${{ runner.os }}-rust-
- name: "⚗️ Build and Test"
run: |
Scripts/build_test_linux
- name: "🧑‍💻 Checkout repository"
uses: actions/checkout@v3

test_carthage:
name: "Verify for Carthage"
runs-on: macos-12

strategy:
fail-fast: true

concurrency:
group: test-carthage-${{ github.ref }}
cancel-in-progress: true
- name: "🏭 Use Xcode ${{ matrix.xcode }}"
run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: "🧰 Prepare tools"
run: |
Scripts/prepare_build_tools
- name: Use Xcode 13.4.1
run: sudo xcode-select -switch /Applications/Xcode_13.4.1.app
- name: "🧪 Run tests (xcodebuild)"
run: |
set -o pipefail && xcodebuild -resolvePackageDependencies && xcodebuild clean test -project PactSwift.xcodeproj -scheme "$SCHEME" -destination "$DESTINATION" GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcbeautify
- name: Carthage build
- name: "⚗️ Run tests (swift)"
run: |
carthage build --use-xcframeworks --no-skip-current
set -o pipefail && swift test -c release
after_success:
needs: [test, test_carthage, test_linux]
name: Build demo projects
needs: [test_ios, test_macos]
name: "🚚 Build demo projects"
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest

steps:
- name: Build demo projects
- name: "🚚 Build demo projects"
run: |
curl -X POST https://api.github.com/repos/surpher/pact-swift-examples/dispatches -H 'Accept: application/vnd.github.everest-preview+json' -u ${{ secrets.PACT_SWIFT_TOKEN }} --data '{"event_type":"PactSwift - ${{ github.event.head_commit.message }}"}'
130 changes: 53 additions & 77 deletions .github/workflows/build_pr.yml
Original file line number Diff line number Diff line change
@@ -1,110 +1,86 @@
name: Build PR
name: Build Pull Request

on:
pull_request:
branches:
- 'main'

env:
RUST_TARGET_PATH: pact-reference
- '!main'

jobs:
test:
name: Run ${{ matrix.platform }} on ${{ matrix.host }}
runs-on: ${{ matrix.host }}

strategy:
fail-fast: true
matrix:
host: [macos-11, macos-12]
platform: [ios, macos]
include:
- platform: ios
scheme: "PactSwift-iOS"
destination: "platform=iOS Simulator,name=iPhone 12 Pro"
- platform: macos
scheme: "PactSwift-macOS"
destination: "arch=x86_64"
test_macos:
name: "🤖 Test macOS"
runs-on: macos-13

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

concurrency:
group: test_macos13_darwin_$SCHEME_${{ github.ref }}
cancel-in-progress: true

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: "🧑‍💻 Checkout repository"
uses: actions/checkout@v3

- name: "⚙️ Use Xcode ${{ env.XCODE_VERSION }}"
run: sudo xcode-select -switch /Applications/Xcode_${{ env.XCODE_VERSION }}.app

- name: Prepare Tools
- name: "🧰 Prepare tools"
run: |
Scripts/prepare_build_tools
- name: Run tests (Xcode)
- name: "🧪 xcodebuild clean test"
run: |
set -o pipefail && xcodebuild clean test -project PactSwift.xcodeproj -scheme "$SCHEME" -destination "$DESTINATION" GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcbeautify
set -o pipefail && xcodebuild -resolvePackageDependencies | xcbeautify && xcodebuild clean test -project PactSwift.xcodeproj -scheme "PactSwift-macOS" -destination "arch=x86_64" | xcbeautify
- name: Run tests (CLI - Swift Package)
- name: "⚗️ swift test"
run: |
swift build
swift test -c release
set -o pipefail && swift test -c release
test_linux:
name: Run on Ubuntu
runs-on: ubuntu-latest

strategy:
fail-fast: true

steps:
- uses: fwal/setup-swift@v1
- name: Get swift version
run: swift --version

- name: Checkout repository
uses: actions/checkout@v2

- name: Install Protoc
uses: arduino/setup-protoc@v1

- name: "♼ Cache rust binaries"
uses: actions/cache@v3
with:
path: |
${{ env.RUST_TARGET_PATH }}
key: build-${{ runner.os }}-rust-pactswift-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
build-${{ runner.os }}-rust-pactswift
build-${{ runner.os }}-rust-
- name: "⚗️ Build and Test"
run: |
Scripts/build_test_linux
test_ios:
name: "🤖 Test iOS"
runs-on: macos-13
needs: [test_macos]

test_carthage:
name: Verify for Carthage
runs-on: macos-12
env:
SCHEME: "PactSwift-iOS"
DESTINATION: "platform=iOS Simulator,name=iPhone 14 Pro"
XCODE_VERSION: 14.3.1

strategy:
fail-fast: true
concurrency:
group: test_macos13_ios_$SCHEME_${{ github.ref }}
cancel-in-progress: true

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: "🧑‍💻 Checkout repository"
uses: actions/checkout@v3

- name: "⚙️ Use Xcode ${{ env.XCODE_VERSION }}"
run: sudo xcode-select -switch /Applications/Xcode_${{ env.XCODE_VERSION }}.app

- name: Use Xcode 13.4.1
run: sudo xcode-select -switch /Applications/Xcode_13.4.1.app
- name: "🧰 Prepare tools"
run: |
Scripts/prepare_build_tools
- name: "♘ Test for Carthage"
run: |
set -o pipefail && carthage build --no-skip-current --use-xcframeworks
- name: Carthage build
- name: "🧪 xcodebuild clean test"
run: |
set -o pipefail && xcodebuild -resolvePackageDependencies | xcbeautify && xcodebuild clean test -project PactSwift.xcodeproj -scheme "PactSwift-iOS" -destination "platform=iOS Simulator,name=iPhone 14 Pro" | xcbeautify
- name: "⚗️ swift test"
run: |
carthage build --use-xcframeworks --no-skip-current
swift test -c release
after_success:
needs: [test, test_carthage, test_linux]
name: Build demo projects
needs: [test_ios]
name: "🚚 Build demo projects"
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest

steps:

- name: Build demo projects
- name: "🚚 Build demo projects"
run: |
curl -X POST https://api.github.com/repos/surpher/pact-swift-examples/dispatches -H 'Accept: application/vnd.github.everest-preview+json' -u ${{ secrets.PACT_SWIFT_TOKEN }} --data '{"event_type":"PactSwift - ${{ github.event.head_commit.message }}"}'
15 changes: 3 additions & 12 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
{
"object": {
"pins": [
{
"package": "PactMockServer",
"repositoryURL": "https://github.com/surpher/PactMockServer.git",
"state": {
"branch": null,
"revision": "11fe519e6d1b0c513c717ba507e89ba401bdf8de",
"version": "0.1.2"
}
},
{
"package": "PactSwiftMockServer",
"repositoryURL": "https://github.com/surpher/PactSwiftMockServer.git",
"repositoryURL": "https://github.com/surpher/PactSwiftServer.git",
"state": {
"branch": null,
"revision": "50c130088b9c7fe7f278beee86b3d161605a1f98",
"version": "0.4.1"
"revision": "12ecc92092ecd3640dcc2dcb98ce6b3d1f2d76f7",
"version": "0.4.7"
}
}
]
Expand Down
Loading

0 comments on commit b2998d4

Please sign in to comment.