feat: add custom update checker and move config to ~/.config/dbcli/ #32
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, master] | |
| pull_request: | |
| branches: [main, master] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| quality: | |
| name: Lint & Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup | |
| uses: ./.github/actions/setup-bun | |
| - name: Quality checks (parallel) | |
| shell: bash | |
| run: | | |
| bun run check:types > /tmp/types.log 2>&1 & | |
| PID_TYPES=$! | |
| bun run check:lint > /tmp/lint.log 2>&1 & | |
| PID_LINT=$! | |
| bun run check:format > /tmp/format.log 2>&1 & | |
| PID_FORMAT=$! | |
| bun run knip > /tmp/knip.log 2>&1 & | |
| PID_KNIP=$! | |
| FAIL=0 | |
| wait $PID_TYPES || FAIL=1 | |
| wait $PID_LINT || FAIL=1 | |
| wait $PID_FORMAT || FAIL=1 | |
| wait $PID_KNIP || FAIL=1 | |
| echo "::group::Type check"; cat /tmp/types.log; echo "::endgroup::" | |
| echo "::group::Lint"; cat /tmp/lint.log; echo "::endgroup::" | |
| echo "::group::Format"; cat /tmp/format.log; echo "::endgroup::" | |
| echo "::group::Knip"; cat /tmp/knip.log; echo "::endgroup::" | |
| exit $FAIL | |
| test-unit: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup | |
| uses: ./.github/actions/setup-bun | |
| - name: Run unit tests | |
| run: bun test tests/config-manager.test.ts tests/crypto.test.ts tests/utils.test.ts | |
| test-postgres: | |
| name: PostgreSQL 18 Tests | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:18-alpine | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: testdb | |
| ports: | |
| - 5433:5432 | |
| options: >- | |
| --health-cmd="pg_isready -U postgres" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install PostgreSQL client | |
| shell: bash | |
| run: | | |
| set -e | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq postgresql-common | |
| sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y | |
| sudo apt-get install -y -qq --no-install-recommends postgresql-client-18 | |
| - name: Setup | |
| uses: ./.github/actions/setup-bun | |
| - name: Run PostgreSQL tests | |
| run: bun test tests/postgres-adapter.integration.test.ts | |
| test-mysql: | |
| name: MySQL 8.4 Tests | |
| runs-on: ubuntu-latest | |
| services: | |
| mysql: | |
| image: mysql:8.4 | |
| env: | |
| MYSQL_ROOT_PASSWORD: mysql | |
| MYSQL_DATABASE: testdb | |
| ports: | |
| - 3307:3306 | |
| options: >- | |
| --health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -pmysql" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install MySQL client | |
| shell: bash | |
| run: | | |
| set -e | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq --no-install-recommends mysql-client | |
| - name: Setup | |
| uses: ./.github/actions/setup-bun | |
| - name: Run MySQL tests | |
| run: bun test tests/mysql-adapter.integration.test.ts | |
| test-mongodb: | |
| name: MongoDB 8 Tests | |
| runs-on: ubuntu-latest | |
| services: | |
| mongodb: | |
| image: mongo:8 | |
| ports: | |
| - 27017:27017 | |
| options: >- | |
| --health-cmd="mongosh --eval 'db.runCommand({ ping: 1 })'" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install MongoDB tools | |
| shell: bash | |
| run: | | |
| set -e | |
| curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc \ | |
| | sudo gpg --dearmor -o /usr/share/keyrings/mongodb-server-8.0.gpg | |
| echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/8.0 multiverse" \ | |
| | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list > /dev/null | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq --no-install-recommends mongodb-mongosh mongodb-database-tools | |
| - name: Setup | |
| uses: ./.github/actions/setup-bun | |
| - name: Run MongoDB tests | |
| run: bun test tests/mongodb-adapter.integration.test.ts | |
| test-mssql-2022: | |
| name: MSSQL 2022 Tests | |
| runs-on: ubuntu-latest | |
| services: | |
| mssql: | |
| image: mcr.microsoft.com/mssql/server:2022-latest | |
| env: | |
| ACCEPT_EULA: 'Y' | |
| MSSQL_SA_PASSWORD: 'YourStrong@Passw0rd' | |
| ports: | |
| - 1433:1433 | |
| options: >- | |
| --health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'YourStrong@Passw0rd' -C -Q 'SELECT 1' || exit 1" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=20 | |
| --health-start-period=30s | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup | |
| uses: ./.github/actions/setup-bun | |
| - name: Run MSSQL tests against 2022 | |
| run: bun test tests/mssql-adapter.integration.test.ts | |
| test-mssql-2017: | |
| name: MSSQL 2017 Tests | |
| runs-on: ubuntu-latest | |
| services: | |
| mssql: | |
| image: mcr.microsoft.com/mssql/server:2017-latest | |
| env: | |
| ACCEPT_EULA: 'Y' | |
| MSSQL_SA_PASSWORD: 'YourStrong@Passw0rd' | |
| ports: | |
| - 1433:1433 | |
| options: >- | |
| --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'YourStrong@Passw0rd' -Q 'SELECT 1' || exit 1" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=20 | |
| --health-start-period=30s | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup | |
| uses: ./.github/actions/setup-bun | |
| - name: Run MSSQL tests against 2017 | |
| run: bun test tests/mssql-adapter.integration.test.ts |