Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
push:
branches:
- axum
pull_request:
branches:
- axum
paths:
- '.github/**'
- 'src/**'
- 'templates/**'
- 'tests/**'

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTFLAGS: "-Dwarnings"
RUSTDOCFLAGS: "-Dwarnings"

jobs:
build_and_test:
runs-on: ubuntu-latest
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
- if: ${{ steps.qbittorrent-nox.outputs.cache-hit != 'true' }}
name: Download qbittorrent-nox
run: wget -O qbittorrent-nox https://github.com/userdocs/qbittorrent-nox-static/releases/download/release-5.0.4_v2.0.11/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: ${{ steps.qbittorrent-nox.outputs.cache-primary-key }}
- 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

10 changes: 10 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set export

RUSTFLAGS := "-Dwarnings"
RUSTDOCFLAGS := "--cfg docs -Dwarnings"

pre-commit *FLAGS:
./scripts/pre-commit.sh {{FLAGS}}

doc *FLAGS:
cargo +nightly doc -Zrustdoc-map --all-features {{FLAGS}}
19 changes: 19 additions & 0 deletions scripts/pre-commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /usr/bin/env bash

export RUSTFLAGS="-Dwarnings"
export RUSTDOCFLAGS="--cfg docsrs -Dwarnings"

set -e
set -x

cargo +nightly --version
cargo +nightly fmt --check
cargo +nightly clippy --all-features
cargo +nightly test
cargo +nightly test --all-features
cargo +nightly doc --no-deps -Zrustdoc-map --all-features
# if command -v cargo-rdme 2>&1 >/dev/null; then
# cargo-rdme --check
# else
# echo "Skip cargo-rdme (not installed)"
# fi
Loading