Skip to content

Commit

Permalink
Fixing and Updating ContributeWordpress.yml (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
leogdion authored Jul 27, 2023
1 parent eef87d4 commit 9631d80
Showing 1 changed file with 55 additions and 40 deletions.
95 changes: 55 additions & 40 deletions .github/workflows/ContributeWordpress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ jobs:
- name: Test
run: swift test --enable-code-coverage
- uses: sersoft-gmbh/swift-coverage-action@v3
id: coverage-files
with:
fail-on-empty-output: true
- name: Upload package coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: ${{join(fromJSON(steps.coverage-files.outputs.files), ',')}}
flags: spm,swift-${{ matrix.swift-version }}
token: ${{ secrets.CODECOV_TOKEN }}
build-macos:
Expand All @@ -80,6 +82,18 @@ jobs:
xcode: "/Applications/Xcode_14.3.app"
iOSVersion: "16.4"
watchOSVersion: "9.4"
watchName: "Apple Watch SE (40mm) (2nd generation)"
iPhoneName: "iPhone 14"
- runs-on: macos-13
xcode: "/Applications/Xcode_14.3.1.app"
iOSVersion: "16.4"
watchOSVersion: "9.4"
watchName: "Apple Watch Series 8 (45mm)"
iPhoneName: "iPhone 14 Pro"
- runs-on: macos-13
xcode: "/Applications/Xcode_15.0.app"
iOSVersion: "17.0"
watchOSVersion: "10.0"
watchName: "Apple Watch Ultra (49mm)"
iPhoneName: "iPhone 14 Pro Max"
steps:
Expand All @@ -95,7 +109,7 @@ jobs:
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}-
- name: Cache mint
if: startsWith(matrix.xcode,'/Applications/Xcode_14.3')
if: startsWith(matrix.xcode,'/Applications/Xcode_14.3.1')
id: cache-mint
uses: actions/cache@v3
env:
Expand All @@ -112,64 +126,65 @@ jobs:
- name: Setup Xcode
run: sudo xcode-select -s ${{ matrix.xcode }}/Contents/Developer
- name: Install mint
if: startsWith(matrix.xcode,'/Applications/Xcode_14.3')
if: startsWith(matrix.xcode,'/Applications/Xcode_14.3.1')
run: |
brew update
brew install mint
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
if: startsWith(matrix.xcode,'/Applications/Xcode_14.3.1')
with:
languages: ${{ matrix.language }}
languages: swift
- name: Build
run: swift build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
if: startsWith(matrix.xcode,'/Applications/Xcode_14.3.1')
- name: Run Swift Package tests
run: swift test -v --enable-code-coverage
if: startsWith(matrix.xcode,'/Applications/Xcode_14.3')
if: startsWith(matrix.xcode,'/Applications/Xcode_14.3.1')
- uses: sersoft-gmbh/swift-coverage-action@v3
id: coverage-files
- name: Upload SPM coverage to Codecov
uses: codecov/codecov-action@v2
if: startsWith(matrix.xcode,'/Applications/Xcode_14.3')
uses: codecov/codecov-action@v3
if: startsWith(matrix.xcode,'/Applications/Xcode_14.3.1')
with:
fail_ci_if_error: true
files: ${{join(fromJSON(steps.coverage-files.outputs.files), ',')}}
flags: spm
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Lint
run: ./scripts/lint.sh
if: startsWith(matrix.xcode,'/Applications/Xcode_14.3')
- name: Dump PIF
if: startsWith(matrix.xcode,'/Applications/Xcode_14.3')
run: |
swift package dump-pif > /dev/null
MAX_ATTEMPT=3
ATTEMPT=0
while [ -z $SUCCESS ] && [ "$ATTEMPT" -le "$MAX_ATTEMPT" ]; do
xcodebuild clean -scheme ContributeWordpress -destination 'generic/platform=iOS' | grep -q "CLEAN SUCCEEDED" && SUCCESS=true
ATTEMPT=$(($ATTEMPT+1))
done
- name: Run iOS target tests
run: xcodebuild test -scheme ContributeWordpress -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test
- uses: sersoft-gmbh/swift-coverage-action@v3
with:
fail-on-empty-output: true
- name: Upload iOS coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
flags: iOS,iOS-${{ matrix.iOSVersion }}
token: ${{ secrets.CODECOV_TOKEN }}
- name: Run watchOS target tests
run: xcodebuild test -scheme ContributeWordpress -sdk watchsimulator -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test
- uses: sersoft-gmbh/swift-coverage-action@v3
with:
fail-on-empty-output: true
- name: Upload watchOS coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
flags: watchOS,watchOS${{ matrix.watchOSVersion }}
token: ${{ secrets.CODECOV_TOKEN }}
if: startsWith(matrix.xcode,'/Applications/Xcode_14.3.1')
# - name: Dump PIF
# if: startsWith(matrix.xcode,'/Applications/Xcode_14.3.1')
# run: |
# swift package dump-pif > /dev/null
# MAX_ATTEMPT=3
# ATTEMPT=0
# while [ -z $SUCCESS ] && [ "$ATTEMPT" -le "$MAX_ATTEMPT" ]; do
# xcodebuild clean -scheme ContributeWordpress -destination 'generic/platform=iOS' | grep -q "CLEAN SUCCEEDED" && SUCCESS=true
# ATTEMPT=$(($ATTEMPT+1))
# done
# - name: Run iOS target tests
# run: xcodebuild test -scheme ContributeWordpress -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test
# - uses: sersoft-gmbh/swift-coverage-action@v3
# with:
# fail-on-empty-output: true
# - name: Upload iOS coverage to Codecov
# uses: codecov/codecov-action@v3
# with:
# fail_ci_if_error: true
# flags: iOS,iOS-${{ matrix.iOSVersion }}
# token: ${{ secrets.CODECOV_TOKEN }}
# - name: Run watchOS target tests
# run: xcodebuild test -scheme ContributeWordpress -sdk watchsimulator -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test
# - uses: sersoft-gmbh/swift-coverage-action@v3
# with:
# fail-on-empty-output: true
# - name: Upload watchOS coverage to Codecov
# uses: codecov/codecov-action@v3
# with:
# fail_ci_if_error: true
# flags: watchOS,watchOS${{ matrix.watchOSVersion }}
# token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 9631d80

Please sign in to comment.