Skip to content

feat: add PostgreSQL database driver #3459

feat: add PostgreSQL database driver

feat: add PostgreSQL database driver #3459

Workflow file for this run

name: Testing
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
format:
name: Formatting
runs-on: ubuntu-latest
steps:
- id: checkout
name: Checkout Repository
uses: actions/checkout@v6
- id: setup
name: Setup Toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt
- id: cache
name: Enable Workflow Cache
uses: Swatinem/rust-cache@v2
- id: format
name: Run Formatting-Checks
run: cargo fmt --check
check:
name: Linting
runs-on: ubuntu-latest
needs: format
timeout-minutes: 15
strategy:
matrix:
toolchain: [nightly, stable]
steps:
- id: checkout
name: Checkout Repository
uses: actions/checkout@v6
- id: setup
name: Setup Toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
components: clippy, rustfmt
- id: node
name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "20"
- id: cache
name: Enable Workflow Cache
uses: Swatinem/rust-cache@v2
- id: tools
name: Install Internal Linter
run: cargo install --locked --git https://github.com/torrust/torrust-linting --bin linter
- id: lint
name: Run All Linters
run: linter all
build:
name: Build on ${{ matrix.os }} (${{ matrix.toolchain }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolchain: [nightly, stable]
steps:
- name: Checkout code
uses: actions/checkout@v6
- id: setup
name: Setup Toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
- name: Build project
run: cargo build --verbose
unit:
name: Units
runs-on: ubuntu-latest
needs: check
strategy:
matrix:
toolchain: [nightly, stable]
steps:
- id: checkout
name: Checkout Repository
uses: actions/checkout@v6
- id: setup
name: Setup Toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
components: llvm-tools-preview
- id: cache
name: Enable Job Cache
uses: Swatinem/rust-cache@v2
- id: tools
name: Install Tools
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov, cargo-nextest
- id: test-docs
name: Run Documentation Tests
run: cargo test --doc --workspace
- id: test
name: Run Unit Tests
run: cargo test --tests --benches --examples --workspace --all-targets --all-features
- id: database
name: Run MySQL Database Tests
run: TORRUST_TRACKER_CORE_RUN_MYSQL_DRIVER_TEST=true cargo test --package bittorrent-tracker-core
e2e:
name: E2E
runs-on: ubuntu-latest
needs: unit
strategy:
matrix:
toolchain: [nightly, stable]
steps:
- id: setup
name: Setup Toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
components: llvm-tools-preview
- id: cache
name: Enable Job Cache
uses: Swatinem/rust-cache@v2
- id: checkout
name: Checkout Repository
uses: actions/checkout@v6
- id: test
name: Run E2E Tests
run: cargo run --bin e2e_tests_runner -- --config-toml-path "./share/default/config/tracker.e2e.container.sqlite3.toml"