ref(error): Improve error handling #1866
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: | |
| types: [opened, synchronize, reopened, labeled] | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| name: Lint | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| strategy: | |
| matrix: | |
| check: [fmt, clippy, sort] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@1.88.0 | |
| with: | |
| components: ${{ matrix.check == 'fmt' && 'rustfmt' || 'clippy' }} | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: ${{ matrix.check }} | |
| - name: Install cargo-sort | |
| if: matrix.check == 'sort' | |
| run: cargo install cargo-sort | |
| - name: Run Cargo Fmt | |
| if: matrix.check == 'fmt' | |
| run: cargo fmt --check | |
| - name: Run Cargo Clippy | |
| if: matrix.check == 'clippy' | |
| run: cargo clippy --all-targets --all-features --no-deps -- -D warnings | |
| - name: Run Cargo Sort | |
| if: matrix.check == 'sort' | |
| run: cargo sort --workspace --grouped --check | |
| test-partial: | |
| name: Tests (Partial) | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| # Run on forks. | |
| if: github.event.pull_request.head.repo.fork == true | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| postgres_version: [18, 17, 16, 15, 14] | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: postgres | |
| POSTGRES_PORT: 5430 | |
| POSTGRES_HOST: localhost | |
| TESTS_DATABASE_HOST: localhost | |
| TESTS_DATABASE_PORT: 5430 | |
| TESTS_DATABASE_USERNAME: postgres | |
| TESTS_DATABASE_PASSWORD: postgres | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@1.88.0 | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: test-partial | |
| - name: Start Docker Compose (Postgres ${{ matrix.postgres_version }}) | |
| run: | | |
| POSTGRES_VERSION=${{ matrix.postgres_version }} docker compose -f ./scripts/docker-compose.yaml up -d | |
| - name: Install sqlx-cli | |
| run: | | |
| cargo install sqlx-cli \ | |
| --features native-tls,postgres \ | |
| --no-default-features \ | |
| --locked | |
| - name: Migrate Database | |
| run: | | |
| sudo apt-get install libpq-dev -y | |
| ./etl-api/scripts/run_migrations.sh | |
| - name: Run Doctests | |
| run: | | |
| cargo test --doc --workspace --all-features --no-fail-fast | |
| - name: Run Unit and Integration Tests | |
| run: | | |
| cargo test \ | |
| --workspace \ | |
| --all-features \ | |
| --no-fail-fast \ | |
| --exclude etl-destinations \ | |
| && \ | |
| cargo test \ | |
| -p etl-destinations \ | |
| --no-default-features \ | |
| --no-fail-fast \ | |
| --features iceberg | |
| - name: Run Exclusive Tests Sequentially | |
| run: | | |
| cargo test \ | |
| --workspace \ | |
| --all-features \ | |
| -- --ignored exclusive_ --test-threads=1 | |
| test-full: | |
| name: Tests (Full) | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| # Run on non-forks. | |
| if: github.event.pull_request.head.repo.fork == false | |
| permissions: | |
| contents: read | |
| id-token: write | |
| strategy: | |
| matrix: | |
| postgres_version: [18, 17, 16, 15, 14] | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: postgres | |
| POSTGRES_PORT: 5430 | |
| POSTGRES_HOST: localhost | |
| TESTS_DATABASE_HOST: localhost | |
| TESTS_DATABASE_PORT: 5430 | |
| TESTS_DATABASE_USERNAME: postgres | |
| TESTS_DATABASE_PASSWORD: postgres | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@1.88.0 | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: test-full | |
| - name: Start Docker Compose (Postgres ${{ matrix.postgres_version }}) | |
| run: | | |
| POSTGRES_VERSION=${{ matrix.postgres_version }} docker compose -f ./scripts/docker-compose.yaml up -d | |
| - name: Install sqlx-cli | |
| run: | | |
| cargo install sqlx-cli \ | |
| --features native-tls,postgres \ | |
| --no-default-features \ | |
| --locked | |
| - name: Migrate Database | |
| run: | | |
| sudo apt-get install libpq-dev -y | |
| ./etl-api/scripts/run_migrations.sh | |
| - name: Set up BigQuery Credentials | |
| run: | | |
| printf '%s' '${{ secrets.TESTS_BIGQUERY_SA_KEY_JSON }}' > /tmp/bigquery-sa-key.json | |
| echo "TESTS_BIGQUERY_PROJECT_ID=${{ secrets.TESTS_BIGQUERY_PROJECT_ID }}" >> $GITHUB_ENV | |
| echo "TESTS_BIGQUERY_SA_KEY_PATH=/tmp/bigquery-sa-key.json" >> $GITHUB_ENV | |
| - name: Run Unit and Integration Tests | |
| if: matrix.postgres_version != 18 | |
| run: | | |
| cargo test \ | |
| --workspace \ | |
| --all-features \ | |
| --no-fail-fast | |
| - name: Run Exclusive Tests Sequentially | |
| if: matrix.postgres_version != 18 | |
| run: | | |
| cargo test \ | |
| --workspace \ | |
| --all-features \ | |
| -- --ignored exclusive_ --test-threads=1 | |
| - name: Install cargo-llvm-cov | |
| if: matrix.postgres_version == 18 | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Run Doctests | |
| run: | | |
| cargo test --doc --workspace --all-features --no-fail-fast | |
| - name: Run Unit and Integration Tests with Coverage | |
| if: matrix.postgres_version == 18 | |
| run: | | |
| cargo llvm-cov test \ | |
| --workspace --no-fail-fast \ | |
| --all-features \ | |
| --no-report | |
| - name: Run Exclusive Tests Sequentially with Coverage | |
| if: matrix.postgres_version == 18 | |
| run: | | |
| cargo llvm-cov test \ | |
| --workspace \ | |
| --all-features \ | |
| --no-report \ | |
| -- --ignored exclusive_ --test-threads=1 | |
| - name: Merge Coverage Data | |
| if: matrix.postgres_version == 18 | |
| run: | | |
| cargo llvm-cov report --lcov --output-path lcov.info | |
| - name: Upload Coverage to Coveralls | |
| if: matrix.postgres_version == 18 | |
| uses: coverallsapp/github-action@v2 | |
| with: | |
| fail-on-error: false | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| path-to-lcov: lcov.info | |
| debug: true |