Add End-to-End Tests #748
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
compile: | |
name: Compile (Swift ${{ matrix.swift_version }}) (${{ matrix.platform }}) | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: macos-14 | |
swift_version: "5.9" | |
xcode_version: "15.2" | |
- platform: ubuntu-22.04 | |
swift_version: "5.9" | |
xcode_version: "15.2" | |
- platform: macos-15 | |
swift_version: "5.10" | |
xcode_version: "15.4" | |
- platform: ubuntu-22.04 | |
swift_version: "5.10" | |
xcode_version: "15.4" | |
- platform: macos-15 | |
swift_version: "6.0" | |
xcode_version: "16.0" | |
- platform: ubuntu-22.04 | |
swift_version: "6.0" | |
xcode_version: "16.0" | |
env: | |
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Swift ${{ matrix.swift_version }} | |
if: ${{ matrix.platform == 'ubuntu-22.04' }} | |
run: wget https://download.swift.org/swift-${{ matrix.swift_version }}-release/ubuntu2204/swift-${{ matrix.swift_version }}-RELEASE/swift-${{ matrix.swift_version }}-RELEASE-ubuntu22.04.tar.gz | |
- name: Extract Swift ${{ matrix.swift_version }} | |
if: ${{ matrix.platform == 'ubuntu-22.04' }} | |
run: tar xzf swift-${{ matrix.swift_version }}-RELEASE-ubuntu22.04.tar.gz | |
- name: Add Swift toolchain to PATH | |
if: ${{ matrix.platform == 'ubuntu-22.04' }} | |
run: echo "$GITHUB_WORKSPACE/swift-${{ matrix.swift_version }}-RELEASE-ubuntu22.04/usr/bin" >> $GITHUB_PATH | |
- run: swift --version | |
- run: swift build --disable-sandbox --configuration release -Xswiftc -warnings-as-errors | |
test: | |
name: Test (Swift ${{ matrix.swift_version }}) (${{ matrix.platform }}) | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: macos-14 | |
swift_version: "5.9" | |
xcode_version: "15.2" | |
- platform: ubuntu-22.04 | |
swift_version: "5.9" | |
xcode_version: "15.2" | |
- platform: macos-15 | |
swift_version: "5.10" | |
xcode_version: "15.4" | |
- platform: ubuntu-22.04 | |
swift_version: "5.10" | |
xcode_version: "15.4" | |
- platform: macos-15 | |
swift_version: "6.0" | |
xcode_version: "16.0" | |
- platform: ubuntu-22.04 | |
swift_version: "6.0" | |
xcode_version: "16.0" | |
env: | |
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Load Swift Version | |
run: echo "SWIFT_VERSION=$(<.swift-version)" >> $GITHUB_ENV | |
- name: Download Swift ${{ matrix.swift_version }} | |
if: ${{ matrix.platform == 'ubuntu-22.04' }} | |
run: wget https://download.swift.org/swift-${{ matrix.swift_version }}-release/ubuntu2204/swift-${{ matrix.swift_version }}-RELEASE/swift-${{ matrix.swift_version }}-RELEASE-ubuntu22.04.tar.gz | |
- name: Extract Swift ${{ matrix.swift_version }} | |
if: ${{ matrix.platform == 'ubuntu-22.04' }} | |
run: tar xzf swift-${{ matrix.swift_version }}-RELEASE-ubuntu22.04.tar.gz | |
- name: Add Swift toolchain to PATH | |
if: ${{ matrix.platform == 'ubuntu-22.04' }} | |
run: echo "$GITHUB_WORKSPACE/swift-${{ matrix.swift_version }}-RELEASE-ubuntu22.04/usr/bin" >> $GITHUB_PATH | |
- run: swift --version | |
- run: swift test --enable-code-coverage | |
- name: Prepare Code Coverage | |
if: ${{ matrix.swift_version == env.SWIFT_VERSION}} | |
run: ./tools/export_coverage | |
- name: Upload coverage reports to Codecov | |
if: ${{ matrix.swift_version == env.SWIFT_VERSION}} | |
uses: codecov/codecov-action@v5 | |
with: | |
files: info.lcov | |
token: ${{ secrets.CODECOV_TOKEN }} | |
end-to-end: | |
name: End-to-End Test (${{ matrix.xcode_version }}) | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- xcode_version: "15.3" | |
uncaptured_output: 255 | |
- xcode_version: "15.4" | |
uncaptured_output: 255 | |
- xcode_version: "16.0" | |
uncaptured_output: 255 | |
- xcode_version: "16.1" | |
uncaptured_output: 255 | |
env: | |
BUILD_LOG: ${{ matrix.xcode_version }}.log | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
with: | |
repository: "cpisciotta/GitHub-Issues-Browser" | |
path: "Demo" | |
- run: swift build | |
- run: set -euo pipefail && xcodebuild clean test -project 'Demo/GHIssues.xcodeproj' -scheme GHIssues -destination 'platform=iOS Simulator,name=iPhone 15 Pro' -derivedDataPath DerivedData CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED=NO ONLY_ACTIVE_ARCH=NO > ${{ env.BUILD_LOG }} | |
- run: ./.build/debug/ParsingCheck --file-path ${{ env.BUILD_LOG }} --uncaptured-output ${{ matrix.uncaptured_output }} |