refactor: migrate peer-id to published torrust-peer-id 0.1.0 #3881
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: Testing | |
| # Path policy: skip this workflow when every changed file is documentation. | |
| # See .github/workflows/docs-lint.yaml for the lightweight docs-only workflow. | |
| on: | |
| push: | |
| paths-ignore: | |
| - "**/*.md" | |
| - "project-words.txt" | |
| pull_request: | |
| paths-ignore: | |
| - "**/*.md" | |
| - "project-words.txt" | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| unit: | |
| name: Unit (${{ matrix.toolchain }}) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: ${{ matrix.timeout_minutes }} | |
| strategy: | |
| matrix: | |
| include: | |
| - toolchain: nightly | |
| components: rustfmt, clippy, llvm-tools-preview | |
| timeout_minutes: 45 | |
| run_format: true | |
| - toolchain: stable | |
| components: clippy, llvm-tools-preview | |
| timeout_minutes: 90 | |
| run_format: false | |
| 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: ${{ matrix.components }} | |
| - id: node | |
| name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "20" | |
| - id: cache | |
| name: Enable Job Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - id: fetch | |
| name: Download Dependencies | |
| run: cargo fetch --verbose | |
| - id: linter | |
| name: Install Internal Linter | |
| run: cargo install --locked --git https://github.com/torrust/torrust-linting --bin linter | |
| - id: tools | |
| name: Install Tools | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-llvm-cov, cargo-nextest | |
| - id: format | |
| name: Run Formatting-Checks | |
| if: ${{ matrix.run_format }} | |
| run: cargo fmt --check | |
| - id: lint | |
| name: Run All Linters | |
| run: linter all | |
| - 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 | |
| docker-e2e: | |
| # Skip this job when container.yaml is also running for the same event — it builds | |
| # the same image and runs the same E2E tests. container.yaml triggers on pushes to | |
| # develop/main/releases and on PRs targeting develop/main. | |
| # For feature branch pushes and PRs targeting other branches, container.yaml does not | |
| # run, so this job provides the only E2E coverage. See issue #1854. | |
| name: Docker E2E | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 90 | |
| if: >- | |
| !(github.event_name == 'pull_request' && | |
| (github.base_ref == 'develop' || github.base_ref == 'main')) && | |
| !(github.event_name == 'push' && | |
| (github.ref == 'refs/heads/develop' || | |
| github.ref == 'refs/heads/main' || | |
| startsWith(github.ref, 'refs/heads/releases/'))) | |
| steps: | |
| - id: checkout | |
| name: Checkout Repository | |
| uses: actions/checkout@v6 | |
| - id: setup | |
| name: Setup Toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| - id: cache | |
| name: Enable Job Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - id: fetch | |
| name: Download Dependencies | |
| run: cargo fetch --verbose | |
| - id: setup-buildx | |
| name: Setup Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - id: build-tracker-image | |
| name: Build Tracker Image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| file: ./Containerfile | |
| push: false | |
| load: true | |
| target: release | |
| tags: torrust-tracker:e2e-local | |
| cache-from: type=gha,scope=testing-docker-e2e | |
| cache-to: type=gha,scope=testing-docker-e2e,mode=max | |
| - id: run-tracker-e2e-tests | |
| name: Run E2E Tests | |
| run: cargo run --bin e2e_tests_runner -- --config-toml-path "./share/default/config/tracker.e2e.container.sqlite3.toml" --tracker-image "torrust-tracker:e2e-local" --skip-build | |
| - id: run-qbittorrent-e2e-test-sqlite3 | |
| name: Run qBittorrent E2E Test (SQLite) | |
| run: cargo run --bin qbittorrent_e2e_runner -- --tracker-image "torrust-tracker:e2e-local" --skip-build --db-driver sqlite3 --timeout-seconds 600 | |
| - id: run-qbittorrent-e2e-test-mysql | |
| name: Run qBittorrent E2E Test (MySQL) | |
| run: cargo run --bin qbittorrent_e2e_runner -- --tracker-image "torrust-tracker:e2e-local" --skip-build --db-driver mysql --timeout-seconds 600 | |
| - id: run-qbittorrent-e2e-test-postgresql | |
| name: Run qBittorrent E2E Test (PostgreSQL) | |
| run: cargo run --bin qbittorrent_e2e_runner -- --tracker-image "torrust-tracker:e2e-local" --skip-build --db-driver postgresql --timeout-seconds 600 |