|
| 1 | +name: Turso Backend Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - trunk |
| 7 | + - d1-support |
| 8 | + - turso-support |
| 9 | + paths: |
| 10 | + - '.github/workflows/turso-backend-tests.yml' |
| 11 | + - 'packages/mysql-on-sqlite/**' |
| 12 | + - 'packages/turso-snapshot-publisher/**' |
| 13 | + pull_request: |
| 14 | + paths: |
| 15 | + - '.github/workflows/turso-backend-tests.yml' |
| 16 | + - 'packages/mysql-on-sqlite/**' |
| 17 | + - 'packages/turso-snapshot-publisher/**' |
| 18 | + workflow_dispatch: |
| 19 | + |
| 20 | +concurrency: |
| 21 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 22 | + cancel-in-progress: true |
| 23 | + |
| 24 | +permissions: {} |
| 25 | + |
| 26 | +jobs: |
| 27 | + # The driver test suites running against the Turso connection backend |
| 28 | + # (over the fake Turso transport; no server needed). |
| 29 | + driver-suites: |
| 30 | + name: Driver suites on Turso backend / PHP ${{ matrix.php }} |
| 31 | + runs-on: ubuntu-latest |
| 32 | + timeout-minutes: 30 |
| 33 | + permissions: |
| 34 | + contents: read |
| 35 | + strategy: |
| 36 | + fail-fast: false |
| 37 | + matrix: |
| 38 | + php: [ '8.0', '8.1', '8.4' ] |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v4 |
| 41 | + |
| 42 | + - uses: shivammathur/setup-php@v2 |
| 43 | + with: |
| 44 | + php-version: ${{ matrix.php }} |
| 45 | + extensions: pdo, pdo_sqlite, curl |
| 46 | + coverage: none |
| 47 | + |
| 48 | + - name: Install dependencies |
| 49 | + working-directory: packages/mysql-on-sqlite |
| 50 | + run: composer install --prefer-dist --no-progress |
| 51 | + |
| 52 | + - name: Run the driver suites against the Turso backend |
| 53 | + working-directory: packages/mysql-on-sqlite |
| 54 | + env: |
| 55 | + WP_SQLITE_TEST_BACKEND: turso |
| 56 | + run: ./vendor/bin/phpunit tests/WP_MySQL_On_SQLite_Tests.php tests/WP_MySQL_On_SQLite_Query_Tests.php tests/WP_MySQL_On_SQLite_Metadata_Tests.php tests/WP_MySQL_On_SQLite_PDO_API_Tests.php |
| 57 | + |
| 58 | + # The snapshot publisher: lint and build. It is exercised against a real |
| 59 | + # server by src/turso/verify-against-server.php, which needs a tursodb; that |
| 60 | + # stays a local check until one is packaged for CI. |
| 61 | + publisher: |
| 62 | + name: Snapshot publisher |
| 63 | + runs-on: ubuntu-latest |
| 64 | + timeout-minutes: 30 |
| 65 | + permissions: |
| 66 | + contents: read |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@v4 |
| 69 | + |
| 70 | + - name: Install Rust toolchain |
| 71 | + uses: dtolnay/rust-toolchain@stable |
| 72 | + with: |
| 73 | + components: rustfmt, clippy |
| 74 | + |
| 75 | + - uses: Swatinem/rust-cache@v2 |
| 76 | + with: |
| 77 | + workspaces: packages/turso-snapshot-publisher |
| 78 | + |
| 79 | + - name: Lint |
| 80 | + working-directory: packages/turso-snapshot-publisher |
| 81 | + run: cargo fmt --check && cargo clippy --no-deps -- -D warnings |
| 82 | + |
| 83 | + - name: Build |
| 84 | + working-directory: packages/turso-snapshot-publisher |
| 85 | + run: cargo build --release |
| 86 | + |
| 87 | + - name: Smoke test |
| 88 | + working-directory: packages/turso-snapshot-publisher |
| 89 | + run: ./target/release/turso-snapshot-publisher --help |
0 commit comments