arnaucube
arnaucube/poulpyPublic Self-hosted repository
poulpy/.github/workflows/ci.yml
.github/workflows/ci.ymlRaw
 1name: CI
 2
 3on:
 4  push:
 5  pull_request:
 6
 7env:
 8  CARGO_TERM_COLOR: always
 9
10jobs:
11  build-and-test:
12    name: Build & Test (stable, beta, nightly)
13    runs-on: ubuntu-latest
14
15    strategy:
16      matrix:
17        toolchain: [stable, beta, nightly]
18
19    steps:
20      - uses: actions/checkout@v4
21
22      - name: Install toolchain
23        uses: actions/setup-rust@v1
24        with:
25          toolchain: ${{ matrix.toolchain }}
26          components: clippy
27
28      - name: Cache cargo registry
29        uses: actions/cache@v3
30        with:
31          path: |
32            ~/.cargo/registry
33            ~/.cargo/git            
34          key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
35          restore-keys: |
36            ${{ runner.os }}-cargo-registry-            
37
38      - name: Cargo fmt check
39        run: cargo fmt --all -- --check
40
41      - name: Build
42        run: cargo build --all-targets --verbose
43
44      - name: Run tests
45        run: cargo test --all-targets --verbose
46
47      - name: Run Clippy
48        run: cargo clippy --all-targets -- -D warnings
49
50  docs:
51    name: Check Documentation
52    runs-on: ubuntu-latest
53    needs: build-and-test
54
55    steps:
56      - uses: actions/checkout@v4
57
58      - uses: actions/setup-rust@v1
59        with:
60          toolchain: stable
61
62      - name: Build docs
63        run: cargo doc --all --no-deps --verbose