Skip to content

Commit

Permalink
refactor: Consolidate build targets (#65)
Browse files Browse the repository at this point in the history
* refactor: Consolidate build targets

* Fix test scheme

* fix app name

* fix badges

* remove folders

* update SPI

* add matrix build to CI

* Update swift.yml

* nit

* Update .codecov.yml

* fix test host

* add dependabot

* Update swift.yml

* remove xcpretty
  • Loading branch information
cbaker6 committed May 13, 2023
1 parent 23f2c1c commit 457627f
Show file tree
Hide file tree
Showing 51 changed files with 414 additions and 2,283 deletions.
7 changes: 3 additions & 4 deletions .codecov.yml
Expand Up @@ -2,14 +2,13 @@ coverage:
ignore:
- Tests/.*
- TestHost/.*
- TestHostTests/.*
- TestHostTV/.*
- TestHostTVTests/.*
status:
patch: true
default:
target: 80
changes: false
project:
default:
target: 90
comment:
require_changes: true
require_changes: false
11 changes: 11 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
82 changes: 64 additions & 18 deletions .github/workflows/swift.yml
Expand Up @@ -6,40 +6,86 @@ on:
pull_request:
branches: [ main ]

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

env:
CI_XCODE_VER: '/Applications/Xcode_11.7.app/Contents/Developer'

jobs:
swift-test-ios:

test:
runs-on: macos-latest

strategy:
matrix:
destination: ['platform=iOS\ Simulator,name=iPhone\ 14\ Pro\ Max', 'platform\=tvOS\ Simulator,name\=Apple\ TV', 'platform=watchOS\ Simulator,name=Apple\ Watch\ Series\ 5\ \(40mm\)', 'platform=macOS']
action: ['test', 'build']
exclude:
- destination: 'platform=iOS\ Simulator,name=iPhone\ 14\ Pro\ Max'
action: 'build'
- destination: 'platform\=tvOS\ Simulator,name\=Apple\ TV'
action: 'build'
- destination: 'platform=macOS'
action: 'build'
- destination: 'platform=watchOS\ Simulator,name=Apple\ Watch\ Series\ 5\ \(40mm\)'
action: 'test'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use multiple cores
run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
- name: Create and set the default keychain
run: |
security create-keychain -p "" temporary
security default-keychain -s temporary
security unlock-keychain -p "" temporary
security set-keychain-settings -lut 7200 temporary
- name: Build
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme CertificateSigningRequest -destination platform\=iOS\ Simulator,name\=iPhone\ 11\ Pro\ Max test | xcpretty
- name: Codecov
run: bash <(curl https://codecov.io/bash)
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme CertificateSigningRequest -derivedDataPath DerivedData -destination ${{ matrix.destination }} ${{ matrix.action }}
- name: Prepare codecov
uses: sersoft-gmbh/swift-coverage-action@v3
id: coverage-files
with:
format: lcov
search-paths: ./DerivedData
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ${{join(fromJSON(steps.coverage-files.outputs.files), ',')}}
fail_ci_if_error: false

swift-test-spm:

runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use multiple cores
run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
- name: Create and set the default keychain
run: |
security create-keychain -p "" temporary
security default-keychain -s temporary
security unlock-keychain -p "" temporary
security set-keychain-settings -lut 7200 temporary
- name: Build and Test
run: swift test --enable-code-coverage -v
run: set -o pipefail && env NSUnbufferedIO=YES swift test --enable-code-coverage
- name: Prepare codecov
run: xcrun llvm-cov export -format="lcov" .build/debug/CertificateSigningRequestPackageTests.xctest/Contents/MacOS/CertificateSigningRequestPackageTests -instr-profile .build/debug/codecov/default.profdata > info.lcov
- name: Codecov
run: bash <(curl https://codecov.io/bash)
uses: sersoft-gmbh/swift-coverage-action@v3
id: coverage-files
with:
format: lcov
search-paths: ./.build
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ${{join(fromJSON(steps.coverage-files.outputs.files), ',')}}
env_vars: SPM
fail_ci_if_error: false

cocoapods:
needs: swift-test-spm
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use multiple cores
run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
- name: CocoaPods
run: set -o pipefail && env NSUnbufferedIO=YES pod lib lint --allow-warnings --verbose

run: set -o pipefail && env NSUnbufferedIO=YES pod lib lint --allow-warnings --verbose
5 changes: 1 addition & 4 deletions .spi.yml
@@ -1,7 +1,4 @@
version: 1
builder:
configs:
- platform: macos-spm
documentation_targets: [CertificateSigningRequest]
- platform: watchos
scheme: "CertificateSigningRequest (watchOS)"
- documentation_targets: [CertificateSigningRequest]

This file was deleted.

22 changes: 0 additions & 22 deletions CertificateSigningRequest (tvOS)/Info.plist

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions CertificateSigningRequest (watchOS)/Info.plist

This file was deleted.

4 changes: 2 additions & 2 deletions CertificateSigningRequest.podspec
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'CertificateSigningRequest'
s.version = '1.29.0'
s.version = '1.30.0'
s.summary = 'Generate self-signed certificate signing requests (CSRs) on iOS, macOS, macCatalyst, watchOS, and tvOS.'

# This description is used to generate tags and improve search results.
Expand All @@ -32,7 +32,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.15'
s.tvos.deployment_target = '13.0'
s.watchos.deployment_target = '6.0'
s.swift_versions = ['4.0', '5.0', '5.1', '5.2', '5.3', '5.4', '5.5', '5.6']
s.swift_versions = ['5.5', '5.6', '5.7', '5.8']
s.source_files = 'Sources/CertificateSigningRequest/**/*.swift'

# s.resource_bundles = {
Expand Down

0 comments on commit 457627f

Please sign in to comment.