chore: Remove SQLite and streamline dependencies #244
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: Continuous Integration | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: "40 9 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| run_tests: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'schedule' || github.event_name == 'push' || github.event.pull_request.merged == false | |
| env: | |
| DB_CONN_STR: ${{ vars.DB_CONN_STR }} | |
| DB_USERNAME: ${{ vars.DB_USERNAME }} | |
| DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 3.4.1 | |
| bundler-cache: true | |
| - name: Validate Couchbase Configuration | |
| run: | | |
| echo "Validating Couchbase environment variables..." | |
| if [ -z "$DB_CONN_STR" ]; then | |
| echo "::error::DB_CONN_STR environment variable is not set" | |
| exit 1 | |
| fi | |
| if [ -z "$DB_USERNAME" ]; then | |
| echo "::error::DB_USERNAME environment variable is not set" | |
| exit 1 | |
| fi | |
| if [ -z "$DB_PASSWORD" ]; then | |
| echo "::error::DB_PASSWORD secret is not set" | |
| exit 1 | |
| fi | |
| echo "✓ All Couchbase environment variables are configured" | |
| env: | |
| DB_CONN_STR: ${{ vars.DB_CONN_STR }} | |
| DB_USERNAME: ${{ vars.DB_USERNAME }} | |
| DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
| - name: Test Couchbase Connection | |
| run: | | |
| bundle exec rails runner ' | |
| begin | |
| if defined?(COUCHBASE_CLUSTER) && COUCHBASE_CLUSTER | |
| bucket = COUCHBASE_CLUSTER.bucket("travel-sample") | |
| puts "✓ Successfully connected to Couchbase cluster" | |
| puts "✓ Successfully accessed travel-sample bucket" | |
| else | |
| puts "✗ Couchbase cluster not initialized" | |
| exit 1 | |
| end | |
| rescue => e | |
| puts "✗ Failed to connect to Couchbase: #{e.class.name} - #{e.message}" | |
| exit 1 | |
| end | |
| ' | |
| env: | |
| DB_CONN_STR: ${{ vars.DB_CONN_STR }} | |
| DB_USERNAME: ${{ vars.DB_USERNAME }} | |
| DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
| CI: true | |
| - name: Run integration tests | |
| run: bundle exec rspec spec/requests/api/v1 | |
| - name: Verify Swagger documentation generates | |
| run: bundle exec rake rswag:specs:swaggerize | |
| env: | |
| DB_CONN_STR: ${{ vars.DB_CONN_STR }} | |
| DB_USERNAME: ${{ vars.DB_USERNAME }} | |
| DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
| CI: true | |
| - name: Report Status | |
| if: always() | |
| uses: ravsamhq/notify-slack-action@v2 | |
| with: | |
| status: ${{ job.status }} | |
| notify_when: "failure,warnings" | |
| notification_title: "Repo: *{repo}*" | |
| message_format: "{emoji} *{status_message}* in <{repo_url}|{repo}@{branch}> on <{commit_url}|{commit_sha}>" | |
| footer: "<{run_url}|View Full Run on GitHub>" | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} |