package resolve filter for ci #727
Workflow file for this run
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: CI | |
| permissions: | |
| contents: read | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: ["main", "release/**"] | |
| pull_request: | |
| branches: ["main", "release/**"] | |
| types: [opened, reopened, synchronize] | |
| # Pushing changes to PR stops currently-running CI | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| # Keep versions in sync with README | |
| SWIFTLINT_VERSION: 0.63.2 | |
| SWIFTFORMAT_VERSION: 0.60.0 | |
| jobs: | |
| soundness: | |
| name: soundness | |
| # Note: this commit is used in soundness & swifttests workflows, so they should be kept in sync | |
| uses: swiftlang/github-workflows/.github/workflows/soundness.yml@61db6917df4ec2ddeeb493757e2d1effd46af855 # 0.0.8 | |
| with: | |
| docs_check_container_image: swift:6.2.2-noble | |
| format_check_enabled: false | |
| tests: | |
| name: swifttests | |
| # Note: this commit is used in soundness & swifttests workflows, so they should be kept in sync | |
| uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@61db6917df4ec2ddeeb493757e2d1effd46af855 # 0.0.8 | |
| with: | |
| enable_windows_checks: false | |
| enable_macos_checks: true | |
| macos_env_vars: SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_BENCHMARKING=1 | |
| macos_exclude_xcode_versions: "[{\"xcode_version\": \"16.3\"}, {\"xcode_version\": \"16.4\"}]" # we require swift 6.2 | |
| macos_pre_build_command: "brew install jemalloc" | |
| macos_build_command: > | |
| swift test --configuration release; | |
| for filename in $(find Snippets -name \*.swift); do | |
| basename=$(basename "$filename" .swift) | |
| swift run -Xlinker -rpath -Xlinker $DEVELOPER_DIR/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/ --configuration release ${basename} | |
| done | |
| linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"6.1\"}]" | |
| linux_env_vars: SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_BENCHMARKING=1 | |
| linux_pre_build_command: "apt-get update && apt-get install -y libjemalloc-dev" | |
| linux_build_command: > | |
| swift test --configuration release; | |
| for filename in $(find Snippets -name \*.swift); do | |
| basename=$(basename "$filename" .swift) | |
| swift run --configuration release ${basename} | |
| done | |
| pre-commit: | |
| timeout-minutes: 1 | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install pre-commit | |
| run: pip install pre-commit | |
| - name: Pre-commit checks | |
| # CI will commit to `main` | |
| # swiftformat, swiftlint and license checks tested separately | |
| run: > | |
| SKIP=no-commit-to-branch,lockwood-swiftformat,swiftlint,check-doc-comments,insert-license | |
| pre-commit run --all-files | |
| insert-license: | |
| timeout-minutes: 1 | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - name: Install pre-commit | |
| run: pip install pre-commit | |
| - name: List changed files | |
| run: git diff --name-only HEAD~1 | |
| - name: Run license check | |
| run: pre-commit run insert-license --files $(git diff --name-only HEAD~1) | |
| lint: | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Cache SwiftLint | |
| id: cache-swiftlint | |
| uses: actions/cache@v5 | |
| with: | |
| path: /tmp/swiftlint/SwiftLint/.build/release/swiftlint | |
| key: ${{ runner.os }}-swiftlint-${{ env.SWIFTLINT_VERSION }} | |
| - name: Install SwiftLint | |
| if: steps.cache-swiftlint.outputs.cache-hit != 'true' | |
| run: | | |
| ci/install-swiftlint.sh | |
| - name: Run SwiftLint | |
| run: /tmp/swiftlint/SwiftLint/.build/release/swiftlint lint --strict . | |
| lockwood-swiftformat: | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Cache SwiftFormat | |
| id: cache-swiftformat | |
| uses: actions/cache@v5 | |
| with: | |
| path: /tmp/swiftformat/SwiftFormat/.build/release/swiftformat | |
| key: ${{ runner.os }}-swiftformat-${{ env.SWIFTFORMAT_VERSION }} | |
| - name: Install Lockwood SwiftFormat | |
| if: steps.cache-swiftformat.outputs.cache-hit != 'true' | |
| run: | | |
| ci/install-lockwood-swiftformat.sh | |
| - name: Run SwiftFormat | |
| run: /tmp/swiftformat/SwiftFormat/.build/release/swiftformat --strict . | |
| check-doc-comments: | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Check documentation comments | |
| run: ci/run-apple-swift-format.sh |