Migrate repo to surrealdb.rb, pin CI, update dependencies #9
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 | |
| with: | |
| ruby-version: "3.3" | |
| bundler-cache: true | |
| - run: bundle exec rubocop | |
| unit-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby: ["3.2", "3.3", "3.4"] | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler-cache: true | |
| - run: bundle exec rspec spec/unit | |
| integration-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby: ["3.3"] | |
| surrealdb: ["v3.0.4"] | |
| transport: [websocket, http] | |
| env: | |
| SURREALDB_WS_URL: ws://localhost:8000 | |
| SURREALDB_HTTP_URL: http://localhost:8000 | |
| SURREALDB_USER: root | |
| SURREALDB_PASS: root | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler-cache: true | |
| - name: Start SurrealDB | |
| run: | | |
| docker run -d --name surrealdb -p 8000:8000 \ | |
| surrealdb/surrealdb:${{ matrix.surrealdb }} \ | |
| start --user root --pass root --allow-all | |
| - name: Wait for SurrealDB | |
| run: | | |
| for i in $(seq 1 30); do | |
| if curl -sf http://localhost:8000/health > /dev/null 2>&1; then | |
| echo "SurrealDB is ready" | |
| exit 0 | |
| fi | |
| sleep 1 | |
| done | |
| echo "SurrealDB failed to start" | |
| docker logs surrealdb | |
| exit 1 | |
| - name: Run integration tests (${{ matrix.transport }}) | |
| run: bundle exec rspec spec/integration/${{ matrix.transport }} | |
| - name: Stop SurrealDB | |
| if: always() | |
| run: docker rm -f surrealdb || true |