meta: Don't require local copy of hightorrent when using git #39
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: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/**' | |
| - 'src/**' | |
| - 'tests/**' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| RUSTFLAGS: "-Dwarnings" | |
| RUSTDOCFLAGS: "-Dwarnings" | |
| jobs: | |
| build_and_test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| version: | |
| - qbt: 5.1.2 | |
| libtorrent: 2.0.11 | |
| - qbt: 5.0.5 | |
| libtorrent: 2.0.11 | |
| # Broken because of field renaming in API since v5.0 | |
| #- qbt: 4.6.7 | |
| # libtorrent: 2.0.10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: clippy, rustfmt | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Restore qbittorrent-nox | |
| id: qbittorrent-nox | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: qbittorrent-nox | |
| key: ${{ runner.os }}-qbittorrent-nox-github-${{ matrix.version.qbt }}-${{ matrix.version.libtorrent }} | |
| - if: ${{ steps.qbittorrent-nox.outputs.cache-hit != 'true' }} | |
| name: Download qbittorrent-nox ${{ matrix.version.qbt }} | |
| run: wget -O qbittorrent-nox https://github.com/userdocs/qbittorrent-nox-static/releases/download/release-${{ matrix.version.qbt }}_v${{ matrix.version.libtorrent }}/x86_64-qbittorrent-nox | |
| - run: chmod +x qbittorrent-nox | |
| - run: sudo ln -s $(pwd)/qbittorrent-nox /usr/local/bin/qbittorrent-nox | |
| - if: ${{ steps.qbittorrent-nox.outputs.cache-hit != 'true' }} | |
| name: Save qbittorrent-nox | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: qbittorrent-nox | |
| key: ${{ runner.os }}-qbittorrent-nox-github-${{ matrix.version.qbt }}-${{ matrix.version.libtorrent }} | |
| - run: mkdir -p /tmp/qbittorrent-nox | |
| - run: ./scripts/qbittorrent.sh start /tmp/qbittorrent-nox 8080 | |
| - run: ./scripts/pre-commit.sh | |
| - run: ./scripts/qbittorrent.sh stop /tmp/qbittorrent-nox | |