[WIP] Add End-to-End Tests #322
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: {} | |
merge_group: {} | |
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: | |
platform: [macos-latest, ubuntu-latest] | |
swift_version: [5.9] | |
steps: | |
- uses: swift-actions/setup-swift@61a116f4030ac34fb5731aab0eff5a0aed94ba29 | |
with: | |
swift-version: ${{ matrix.swift_version }} | |
- uses: actions/checkout@v4 | |
- run: swift build --disable-sandbox --configuration release -Xswiftc -warnings-as-errors | |
test: | |
name: Test (${{ matrix.platform}}) | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
matrix: | |
platform: [macos-13, ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Load Swift Version | |
run: echo "SWIFT_VERSION=$(<.swift-version)" >> $GITHUB_ENV | |
- name: Install Swift and Tools | |
uses: swift-actions/setup-swift@cdbe0f7f4c77929b6580e71983e8606e55ffe7e4 | |
with: | |
swift-version: ${{ env.SWIFT_VERSION }} | |
- run: swift test --enable-code-coverage | |
- name: Prepare Code Coverage | |
run: ./tools/export_coverage | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
files: info.lcov | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
large_build_log: | |
name: Large Build Log | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: swift build | |
- run: | | |
LARGE_LOG_PATH=`find Tests -name large_xcodebuild_log.txt` | |
cat $LARGE_LOG_PATH | ./.build/debug/xcbeautify | |
env: | |
XCB_RECORD_UNCAPTURED: true | |
- name: Check for large build log | |
run: | | |
FILE_LENGTH=$(wc -l < ./uncaptured.txt) | |
if [ $FILE_LENGTH -gt 14922 ]; then | |
echo "File length is $FILE_LENGTH" | |
exit 1 | |
fi |