Port C# @name parameter fixes to Swift MySQL and Postgres drivers #62
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 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main, develop] | |
| paths-ignore: | |
| - '**.md' | |
| - '.spi.yml' | |
| - 'Sources/**/*.docc/**' | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - '**.md' | |
| - '.spi.yml' | |
| - 'Sources/**/*.docc/**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| # Environment variables shared across all jobs | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| env: | |
| SWIFT_VERSION: "6.0" | |
| jobs: | |
| # ─────────────────────────────────────────────────────────────────────────── | |
| # 1. SQLite + Core tests — macOS (Swift pre-installed, ~1 min) | |
| # ─────────────────────────────────────────────────────────────────────────── | |
| test-sqlite-macos: | |
| name: SQLite — macOS / Swift 6.0 | |
| runs-on: macos-15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache SPM | |
| uses: actions/cache@v4 | |
| with: | |
| path: .build | |
| key: macos-spm-v2-${{ env.SWIFT_VERSION }}-${{ hashFiles('Package.resolved') }} | |
| restore-keys: macos-spm-v2-${{ env.SWIFT_VERSION }}- | |
| - run: swift test --filter SQLiteNioTests 2>&1 | |
| - run: swift test --filter SQLNioCoreTests --skip-build 2>&1 | |
| # ─────────────────────────────────────────────────────────────────────────── | |
| # 2. All integration tests in one Linux job — build once, test all three DBs | |
| # Connects to vps.marivil.com (Docker containers, always up). | |
| # ─────────────────────────────────────────────────────────────────────────── | |
| test-integration: | |
| name: Integration tests (MSSQL · PostgreSQL · MySQL · SQLite/Linux) | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Swift ${{ env.SWIFT_VERSION }} | |
| uses: swift-actions/setup-swift@v2 | |
| with: | |
| swift-version: ${{ env.SWIFT_VERSION }} | |
| - name: Install SQLite | |
| run: sudo apt-get install -y libsqlite3-dev | |
| - name: Cache SPM | |
| uses: actions/cache@v4 | |
| with: | |
| path: .build | |
| key: linux-spm-v2-${{ env.SWIFT_VERSION }}-${{ hashFiles('Package.resolved') }} | |
| restore-keys: linux-spm-v2-${{ env.SWIFT_VERSION }}- | |
| - name: Build | |
| run: swift build --build-tests --configuration debug 2>&1 | |
| - name: SQLite tests | |
| run: swift test --filter SQLiteNioTests --skip-build 2>&1 | |
| - name: SQLite Core tests | |
| run: swift test --filter SQLNioCoreTests --skip-build 2>&1 | |
| - name: MSSQL tests | |
| env: | |
| MSSQL_TEST_HOST: ${{ secrets.MSSQL_TEST_HOST }} | |
| MSSQL_TEST_PASS: ${{ secrets.MSSQL_TEST_PASS }} | |
| MSSQL_TEST_DB: MSSQLNioTestDb | |
| MSSQL_TEST_USER: sa | |
| run: swift test --filter MSSQLNioTests --skip-build 2>&1 | |
| - name: PostgreSQL tests | |
| env: | |
| PG_TEST_HOST: ${{ secrets.PG_TEST_HOST }} | |
| PG_TEST_DB: PostgresNioTestDb | |
| PG_TEST_USER: pguser | |
| PG_TEST_PASS: ${{ secrets.PG_TEST_PASS }} | |
| run: swift test --filter PostgresNioTests --skip-build 2>&1 | |
| - name: MySQL tests | |
| env: | |
| MYSQL_TEST_HOST: ${{ secrets.MYSQL_TEST_HOST }} | |
| MYSQL_TEST_DB: MySQLNioTestDb | |
| MYSQL_TEST_USER: mysqluser | |
| MYSQL_TEST_PASS: ${{ secrets.MYSQL_TEST_PASS }} | |
| run: swift test --filter MySQLNioTests --skip-build 2>&1 | |
| # ─────────────────────────────────────────────────────────────────────────── | |
| # 3. Summary / Required status check | |
| # ─────────────────────────────────────────────────────────────────────────── | |
| ci-success: | |
| name: All tests passed | |
| runs-on: ubuntu-24.04 | |
| needs: [test-sqlite-macos, test-integration] | |
| if: always() | |
| steps: | |
| - name: Check results | |
| run: | | |
| if [[ "${{ needs.test-sqlite-macos.result }}" != "success" || \ | |
| "${{ needs.test-integration.result }}" != "success" ]]; then | |
| echo "One or more test jobs failed." | |
| exit 1 | |
| fi | |
| echo "All test jobs passed." |