Add tests for BuildPhaseHasher #1
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: Checks | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: [main] | |
paths-ignore: ['Docs/**', 'README.md'] | |
jobs: | |
swiftformat: | |
name: SwiftFormat | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: swiftformat . --lint --quiet --reporter github-actions-log | |
swiftlint: | |
name: SwiftLint | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: swiftlint --strict --quiet --reporter github-actions-logging | |
install: | |
name: Install Script | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rugby | |
run: | | |
curl -Ls curl -Ls https://swiftyfinch.github.io/rugby/install.sh | bash | |
chmod +x ~/.rugby/clt/rugby && echo ~/.rugby/clt >> $GITHUB_PATH | |
- run: rugby -h | |
release: | |
name: Build Binary | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: .build | |
key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }} | |
restore-keys: ${{ runner.os }}-spm- | |
- name: Build | |
run: swift build -c release | |
tests: | |
name: Unit Tests | |
runs-on: macos-latest | |
env: | |
LCOV_PATH: .build/artifacts/info.lcov | |
BUILD_FOLDER: .build/debug/RugbyPackageTests.xctest/Contents/MacOS/RugbyPackageTests | |
PROFDATA_FOLDER: .build/debug/codecov/default.profdata | |
IGNORE_FILENAME_REGEX: .build|Tests | |
steps: | |
- uses: actions/checkout@v3 | |
- run: brew install xcbeautify | |
- uses: actions/cache@v3 | |
with: | |
path: .build | |
key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }} | |
restore-keys: ${{ runner.os }}-spm- | |
- name: Test | |
run: set -o pipefail && swift test --enable-code-coverage 2>&1 | xcbeautify | |
- name: Prepare coverage to upload | |
run: | | |
xcrun llvm-cov export $BUILD_FOLDER \ | |
-instr-profile $PROFDATA_FOLDER > $LCOV_PATH \ | |
--ignore-filename-regex=$IGNORE_FILENAME_REGEX \ | |
-format="lcov" \ | |
--use-color | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Prepare binary artifact | |
run: | | |
RUGBY_PATH=`swift build --show-bin-path`/rugby | |
strip -rSTx $RUGBY_PATH | |
echo "RUGBY_PATH=$RUGBY_PATH" >> $GITHUB_ENV | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: rugby | |
path: ${{ env.RUGBY_PATH }} | |
smoke-frameworks: | |
name: Smoke (Frameworks) | |
needs: tests | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: { name: rugby } | |
- run: chmod +x rugby && echo `pwd` >> $GITHUB_PATH | |
- run: rugby --version | |
- uses: actions/cache@v3 | |
with: | |
path: Example/Pods | |
key: ${{ runner.os }}-pods-${{ hashFiles('Example/Podfile.lock') }} | |
restore-keys: ${{ runner.os }}-pods- | |
- name: CocoaPods | |
working-directory: ./Example | |
run: pod install --repo-update | |
- name: Rugby | |
working-directory: ./Example | |
run: rugby --prebuild --targets Pods-ExampleFrameworks --output multiline | |
- run: brew install xcbeautify | |
- name: XcodeBuild Test | |
working-directory: ./Example | |
run: | | |
set -o pipefail && env NSUnbufferedIO=YES xcodebuild test \ | |
-workspace Example.xcworkspace \ | |
-scheme ExampleFrameworks \ | |
-configuration Debug \ | |
-destination 'platform=iOS Simulator,name=iPhone 14' \ | |
-derivedDataPath build \ | |
COMPILER_INDEX_STORE_ENABLE=NO \ | |
SWIFT_COMPILATION_MODE=wholemodule \ | |
| xcbeautify | |
smoke-libs: | |
name: Smoke (Libraries) | |
needs: tests | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: { name: rugby } | |
- run: chmod +x rugby && echo `pwd` >> $GITHUB_PATH | |
- run: rugby --version | |
- uses: actions/cache@v3 | |
with: | |
path: Example/Pods | |
key: ${{ runner.os }}-pods-${{ hashFiles('Example/Podfile.lock') }} | |
restore-keys: ${{ runner.os }}-pods- | |
- name: CocoaPods | |
working-directory: ./Example | |
run: pod install --repo-update | |
- name: Rugby | |
working-directory: ./Example | |
run: rugby --prebuild --targets Pods-ExampleLibs --output multiline | |
- run: brew install xcbeautify | |
- name: XcodeBuild Test | |
working-directory: ./Example | |
run: | | |
set -o pipefail && env NSUnbufferedIO=YES xcodebuild test \ | |
-workspace Example.xcworkspace \ | |
-scheme ExampleLibs \ | |
-configuration Debug \ | |
-destination 'platform=iOS Simulator,name=iPhone 14' \ | |
-derivedDataPath build \ | |
COMPILER_INDEX_STORE_ENABLE=NO \ | |
SWIFT_COMPILATION_MODE=wholemodule \ | |
| xcbeautify |