Build and Test #15
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: Build and Test | |
| on: [pull_request, workflow_dispatch] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| container: node:22 | |
| services: | |
| postgres: | |
| image: postgres:10 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: postgres | |
| POSTGRES_HOST: postgres | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_URL: postgresql://postgres:postgres@postgres:5432/postgres | |
| POSTGRES_INITDB_ARGS: "--wal-level=logical" | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| debezium: | |
| image: debezium/server:3.0.0.Final | |
| env: | |
| DATABASE_USER: default | |
| DEBEZIUM_FORMAT_SCHEMAS_ENABLE: false | |
| DEBEZIUM_SINK_REDIS_ADDRESS: redis:6379 | |
| DEBEZIUM_SINK_REDIS_PASSWORD: | |
| DEBEZIUM_SINK_REDIS_SSL_ENABLED: false | |
| DEBEZIUM_SINK_REDIS_WAIT_RETRY_ENABLED: true | |
| DEBEZIUM_SINK_TYPE: redis | |
| DEBEZIUM_SOURCE_CONNECTOR_CLASS: io.debezium.connector.postgresql.PostgresConnector | |
| DEBEZIUM_SOURCE_DATABASE_DBNAME: postgres | |
| DEBEZIUM_SOURCE_DATABASE_HOSTNAME: postgres | |
| DEBEZIUM_SOURCE_DATABASE_PASSWORD: postgres | |
| DEBEZIUM_SOURCE_DATABASE_PORT: 5432 | |
| DEBEZIUM_SOURCE_DATABASE_SERVER_NAME: zenstack | |
| DEBEZIUM_SOURCE_DATABASE_USER: postgres | |
| DEBEZIUM_SOURCE_PLUGIN_NAME: pgoutput | |
| DEBEZIUM_SOURCE_SCHEMA_WHITELIST: public | |
| DEBEZIUM_SOURCE_SNAPSHOT_MODE: no_data | |
| DEBEZIUM_SOURCE_TOPIC_PREFIX: zenstack.table | |
| DEBEZIUM_SOURCE_SCHEMA_HISTORY_INTERNAL: io.debezium.storage.redis.history.RedisSchemaHistory | |
| DEBEZIUM_SOURCE_OFFSET_STORAGE: io.debezium.storage.redis.offset.RedisOffsetBackingStore | |
| DEBEZIUM_SOURCE_OFFSET_STORAGE_REDIS_KEY: zenstack.metadata.offsets | |
| SCHEMA_INCLUDE_LIST: public | |
| # options: >- | |
| # --health-cmd "curl -f http://localhost:8080/q/health" | |
| # --health-interval 5s | |
| # --health-timeout 5s | |
| # --health-retries 5 | |
| redis: | |
| image: redis:6.2 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v5 | |
| - name: Install system dependencies | |
| run: | | |
| apt-get update | |
| apt-get install -y unzip | |
| - name: Setup bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install project dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build | |
| run: bun run build | |
| - name: Test | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: postgres | |
| POSTGRES_HOST: postgres | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_URL: postgresql://postgres:postgres@postgres:5432/postgres | |
| REDIS_URL: redis://redis:6379 | |
| run: bun run test |