Sendable cleanup #252
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: test | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| pull_request: { types: [opened, reopened, synchronize, ready_for_review] } | |
| push: { branches: [ main ] } | |
| env: | |
| LOG_LEVEL: info | |
| SWIFT_DETERMINISTIC_HASHING: 1 | |
| POSTGRES_HOSTNAME: 'psql-a' | |
| POSTGRES_HOSTNAME_A: 'psql-a' | |
| POSTGRES_HOSTNAME_B: 'psql-b' | |
| POSTGRES_DB: 'test_database' | |
| POSTGRES_DB_A: 'test_database' | |
| POSTGRES_DB_B: 'test_database' | |
| POSTGRES_USER: 'test_username' | |
| POSTGRES_USER_A: 'test_username' | |
| POSTGRES_USER_B: 'test_username' | |
| POSTGRES_PASSWORD: 'test_password' | |
| POSTGRES_PASSWORD_A: 'test_password' | |
| POSTGRES_PASSWORD_B: 'test_password' | |
| jobs: | |
| api-breakage: | |
| if: ${{ github.event_name == 'pull_request' && !(github.event.pull_request.draft || false) }} | |
| runs-on: ubuntu-latest | |
| container: swift:noble | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: { 'fetch-depth': 0 } | |
| - name: API breaking changes | |
| run: | | |
| git config --global --add safe.directory "${GITHUB_WORKSPACE}" | |
| swift package diagnose-api-breaking-changes origin/main | |
| linux-unit: | |
| if: ${{ !(github.event.pull_request.draft || false) }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| postgres-image: | |
| - postgres:17 | |
| - postgres:15 | |
| - postgres:13 | |
| swift-image: | |
| - swift:5.9-jammy | |
| - swift:5.10-noble | |
| - swift:6.0-noble | |
| include: | |
| - postgres-image: postgres:17 | |
| postgres-auth: scram-sha-256 | |
| - postgres-image: postgres:15 | |
| postgres-auth: md5 | |
| - postgres-image: postgres:13 | |
| postgres-auth: trust | |
| runs-on: ubuntu-latest | |
| container: ${{ matrix.swift-image }} | |
| services: | |
| psql-a: | |
| image: ${{ matrix.postgres-image }} | |
| env: | |
| POSTGRES_USER: test_username | |
| POSTGRES_DB: test_database | |
| POSTGRES_PASSWORD: test_password | |
| POSTGRES_HOST_AUTH_METHOD: ${{ matrix.postgres-auth }} | |
| POSTGRES_INITDB_ARGS: --auth-host=${{ matrix.postgres-auth }} | |
| steps: | |
| - name: Check out package | |
| uses: actions/checkout@v4 | |
| - name: Run local tests | |
| run: swift test --sanitize=thread --enable-code-coverage | |
| - name: Upload coverage data | |
| uses: vapor/swift-codecov-action@v0.3 | |
| with: | |
| codecov_token: ${{ secrets.CODECOV_TOKEN || '' }} | |
| linux-integration: | |
| if: ${{ !(github.event.pull_request.draft || false) }} | |
| runs-on: ubuntu-latest | |
| container: swift:6.0-noble | |
| services: | |
| psql-a: | |
| image: postgres:17 | |
| env: | |
| POSTGRES_USER: test_username | |
| POSTGRES_DB: test_database | |
| POSTGRES_PASSWORD: test_password | |
| POSTGRES_HOST_AUTH_METHOD: scram-sha-256 | |
| POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256 | |
| psql-b: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_USER: test_username | |
| POSTGRES_DB: test_database | |
| POSTGRES_PASSWORD: test_password | |
| POSTGRES_HOST_AUTH_METHOD: scram-sha-256 | |
| POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256 | |
| steps: | |
| - name: Check out package | |
| uses: actions/checkout@v4 | |
| with: { path: 'postgres-kit' } | |
| - name: Check out fluent-postgres-driver dependent | |
| uses: actions/checkout@v4 | |
| with: { repository: 'vapor/fluent-postgres-driver', path: 'fluent-postgres-driver' } | |
| - name: Use local package | |
| run: swift package --package-path fluent-postgres-driver edit postgres-kit --path postgres-kit | |
| - name: Run fluent-postgres-kit tests | |
| run: swift test --package-path fluent-postgres-driver --sanitize=thread | |
| macos-unit: | |
| if: ${{ !(github.event.pull_request.draft || false) }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - macos-version: macos-14 | |
| xcode-version: latest-stable | |
| - macos-version: macos-15 | |
| xcode-version: latest-stable | |
| runs-on: ${{ matrix.macos-version }} | |
| env: | |
| POSTGRES_HOSTNAME: 127.0.0.1 | |
| POSTGRES_DB: postgres | |
| steps: | |
| - name: Select latest available Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: ${{ matrix.xcode-version }} | |
| - name: Install Postgres, setup DB and auth, and wait for server start | |
| run: | | |
| brew upgrade || true | |
| export PATH="$(brew --prefix)/opt/postgresql@13/bin:$PATH" PGDATA=/tmp/vapor-postgres-test | |
| (brew unlink postgresql@14 || true) && brew install "postgresql@13" && brew link --force "postgresql@13" | |
| initdb --locale=C --auth-host "scram-sha-256" -U "${POSTGRES_USER}" --pwfile=<(echo "${POSTGRES_PASSWORD}") | |
| pg_ctl start --wait | |
| timeout-minutes: 15 | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Run local tests | |
| run: swift test --sanitize=thread --enable-code-coverage | |
| - name: Upload coverage data | |
| uses: vapor/swift-codecov-action@v0.3 | |
| with: | |
| codecov_token: ${{ secrets.CODECOV_TOKEN || '' }} | |
| musl: | |
| runs-on: ubuntu-latest | |
| container: swift:6.0-noble | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Install SDK | |
| run: swift sdk install https://download.swift.org/swift-6.0.3-release/static-sdk/swift-6.0.3-RELEASE/swift-6.0.3-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz --checksum 67f765e0030e661a7450f7e4877cfe008db4f57f177d5a08a6e26fd661cdd0bd | |
| - name: Build | |
| run: swift build --swift-sdk x86_64-swift-linux-musl |