File: format_and_lint.yml

package info (click to toggle)
patch-hub 0.1.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,616 kB
  • sloc: xml: 142; makefile: 33
file content (61 lines) | stat: -rw-r--r-- 1,406 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Format and Lint

on:
  pull_request:
    types:
      - opened
      - synchronize
      - reopened
      - ready_for_review
      - labeled
    paths:
      - src/**
  push:
    paths:
      - src/**
    branches: 
      - master
      - unstable

jobs:
  format:
    runs-on: ubuntu-latest
    timeout-minutes: 2
    if: '!github.event.pull_request.draft'
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha }}

      - name: Update rustup and install rustfmt
        shell: bash
        run: |
          rustup update
          rustup component add rustfmt
          rustup install stable

      - name: Check rustfmt errors
        shell: bash
        run: |
          cargo fmt --all -- --check

  lint:
    runs-on: ubuntu-latest
    timeout-minutes: 2
    if: '!github.event.pull_request.draft'
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha }}

      - name: Update rustup and install clippy
        shell: bash
        run: |
          rustup update
          rustup component add clippy
          rustup install stable

      - name: Check clippy errors
        shell: bash
        run: |
          cargo clippy --all-features --all-targets --tests -- --allow=clippy::too-many-arguments --deny=warnings --deny=clippy::map_unwrap_or --deny=unconditional_recursion