qbittorrent_web_api/.github/workflows/ci.yml
Joel Wachsler 6e483c1dc0 Update ci
2022-08-13 18:15:51 +00:00

92 lines
1.8 KiB
YAML

name: CI
on:
push:
branches: [main, staging, trying]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-22.04
services:
# Needed for tests to pass
qbittorrent:
image: linuxserver/qbittorrent:4.4.3
ports:
- 8080:8080
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-test-${{ hashFiles('Cargo.toml') }}
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --verbose
fmt:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
override: true
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('Cargo.toml') }}
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings