feat: redesign Backend trait #138
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: Code Quality | |
| on: | |
| - push | |
| - pull_request | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - name: Install OS dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install libdbus-1-dev pkg-config | |
| - name: Run clippy | |
| run: cargo clippy --all --all-targets --all-features -- -D warnings | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| # we use some nightly rustfmt features, so we need nightly toolchain | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: rustfmt | |
| - name: Check formatting | |
| run: cargo +nightly fmt --all -- --check | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| # - name: Install Tarpaulin | |
| # run: | | |
| # cargo install cargo-tarpaulin | |
| - name: Install OS dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install libdbus-1-dev pkg-config | |
| - name: Run tests | |
| run: cargo test --all --all-features | |
| # - name: Generate coverage report | |
| # run: cargo tarpaulin --features patches --out xml --skip-clean | |
| # - name: Upload coverage reports to Codecov | |
| # uses: codecov/codecov-action@v4.0.1 | |
| # with: | |
| # token: ${{ secrets.CODECOV_TOKEN }} | |
| sql-consistency: | |
| name: Check SQL (${{ matrix.db }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - db: mysql | |
| database_url: mysql://root:root@127.0.0.1:3306/test-pesde-registry | |
| services: | |
| mariadb: | |
| image: ${{ matrix.db == 'mysql' && 'mariadb:11.8' || '' }} | |
| ports: | |
| - 3306:3306 | |
| env: | |
| MARIADB_ROOT_PASSWORD: root | |
| options: >- | |
| --health-cmd="mariadb-admin ping" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| env: | |
| DATABASE_URL: ${{ matrix.database_url }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install SQLx CLI | |
| run: | | |
| cargo install sqlx-cli@^0.9 | |
| - name: Setup database | |
| working-directory: crates/registry-backend-${{ matrix.db }} | |
| run: cargo sqlx database setup | |
| - name: Check query state | |
| working-directory: crates/registry-backend-${{ matrix.db }} | |
| run: cargo sqlx prepare --check |