test(base-message): add test to cover base message and base incoming … #12
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: Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Dump GitHub context | |
| env: | |
| GITHUB_CONTEXT: ${{ toJson(github) }} | |
| run: echo "$GITHUB_CONTEXT" | |
| - uses: actions/checkout@v4 | |
| - name: Install the latest version of uv and set the python version to 3.13t | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| python-version: 3.11 | |
| - name: Lint | |
| run: uv run bash scripts/lint.sh | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13"] | |
| fail-fast: false | |
| services: | |
| postgres: | |
| image: postgres | |
| env: | |
| POSTGRES_PASSWORD: chanx_test_pass | |
| POSTGRES_DB: chanx_test_db | |
| POSTGRES_USER: chanx_test_user | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| redis: | |
| image: redis | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 6379:6379 | |
| env: | |
| POSTGRES_DB: chanx_test_db | |
| POSTGRES_USER: chanx_test_user | |
| POSTGRES_PASSWORD: chanx_test_pass | |
| POSTGRES_HOST: localhost | |
| POSTGRES_PORT: 5432 | |
| REDIS_HOST: redis://localhost:6379 | |
| steps: | |
| - name: Dump GitHub context | |
| env: | |
| GITHUB_CONTEXT: ${{ toJson(github) }} | |
| run: echo "$GITHUB_CONTEXT" | |
| - uses: actions/checkout@v4 | |
| - name: Install the latest version of uv and set the python version | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| - run: mkdir coverage | |
| - name: Test | |
| run: uv run --group test --all-extras coverage run -m pytest sandbox | |
| env: | |
| COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }} | |
| CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }} | |
| - name: Store coverage files | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: coverage |