Fair CI #3016
This file contains hidden or 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: Fair CI | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| tags: | |
| - "[0-9]+.[0-9]+.[0-9]+" | |
| pull_request: | |
| branches: | |
| - '*' | |
| schedule: | |
| - cron: '0 0,12 * * *' | |
| jobs: | |
| ci-linux: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 90 | |
| env: | |
| FAIRHUB_API_SKIP: true # used by tests to determine load | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Get swift version | |
| run: swift --version | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Run fairtool | |
| run: | | |
| swift run fairtool version | |
| - name: Fair Test Linux (Debug) | |
| run: swift test -v --configuration debug --parallel | |
| - name: Fair Test Linux (Release) | |
| if: false | |
| run: swift test -v --configuration release -Xswiftc -enable-testing --parallel | |
| ci-macOS: | |
| runs-on: macos-latest | |
| timeout-minutes: 90 | |
| env: | |
| #DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| FAIRHUB_API_SKIP: true # used by tests to determine load | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Test iOS (Debug) | |
| if: false | |
| run: xcodebuild test -configuration Debug -scheme "Fair-Package" -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 14 Pro" | |
| - name: Test iOS (Release) | |
| if: false | |
| run: xcodebuild test -configuration Release -scheme "Fair-Package" -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 14 Pro" | |
| - name: Test macOS (Debug) | |
| if: false | |
| run: xcodebuild test -configuration Debug -scheme "Fair-Package" -sdk "macosx" -destination "platform=macOS" | |
| - name: Test macOS (Release) | |
| if: false | |
| run: xcodebuild test -configuration Release -scheme "Fair-Package" -sdk "macosx" -destination "platform=macOS" | |
| - name: Test Package | |
| #run: xcrun swift test --parallel | |
| run: swift test | |
| - name: Run fairtool | |
| run: xcrun swift run fairtool version | |
| # build binary artifact for macOS and Static Linux | |
| - name: Install swiftly | |
| run: brew install swiftly | |
| - name: Install Swift 6.2 host toolchain | |
| run: swiftly init --skip-install --assume-yes --verbose && swiftly install 6.2.0 | |
| - name: Install Static Linux SDK | |
| run: swift sdk install https://download.swift.org/swift-6.2-release/static-sdk/swift-6.2-RELEASE/swift-6.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz --checksum d2225840e592389ca517bbf71652f7003dbf45ac35d1e57d98b9250368769378 | |
| - name: Package fairtool | |
| run: scripts/package_fairtool.sh | |
| - name: Upload Build Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: fairtool-bin.zip | |
| - name: Create Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| # Create a release or upload the assets if the release already exists | |
| run: | | |
| VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//') | |
| gh release create "${VERSION}" -t "${VERSION}" --generate-notes fairtool-bin.zip | |