summaryrefslogtreecommitdiffstats
path: root/.github/workflows/pull-request.yml
blob: 061c4d478f9af66dec58ef14d6af4cdfcc72c185 (plain)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Pull Request

on:
  pull_request:
  push: # run CI/CD against master as well, to generate cache
    branches:
      - master

jobs:
  linux:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - uses: baptiste0928/cargo-install@v2
        with:
          crate: cargo-make
      - name: Test
        run: cargo make test
      - name: Build Release
        run: cargo make build --release
      - name: Run
        run: cargo run --release -- --version
  lint:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - uses: Swatinem/rust-cache@v2
      - uses: baptiste0928/cargo-install@v2
        with:
          crate: cargo-make
      - run: cargo make lint-stable
  docs:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@stable
      - run: cargo doc --all-features --workspace
  format:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: nightly
          components: rustfmt
      - uses: Swatinem/rust-cache@v2
      - uses: baptiste0928/cargo-install@v2
        with:
          crate: cargo-make
      - run: cargo make format
  coverage:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: nightly
      - uses: Swatinem/rust-cache@v2
      - uses: baptiste0928/cargo-install@v2
        with:
          crate: cargo-tarpaulin
      - name: Run cargo-tarpaulin
        run: |
          cargo +nightly tarpaulin --workspace --all-features --ignore-tests --line --output-dir coverage --timeout 10 --out Lcov
      - name: Post to Coveralls
        uses: coverallsapp/github-action@v2
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          path-to-lcov: "coverage/lcov.info"
  macos:
    name: macos
    runs-on: macos-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - uses: baptiste0928/cargo-install@v2
        with:
          crate: cargo-make
      - name: Test
        run: cargo make test
      - name: Build Release
        run: cargo make build --release
      - name: Run
        run: cargo run --release -- --version
  windows:
    name: windows
    runs-on: windows-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - name: Test
        env:
          RUSTFLAGS: '--cap-lints warn'
        run: cargo test --target x86_64-pc-windows-msvc --workspace
      - name: Build and Run
        env:
          RUSTFLAGS: '--cap-lints warn'
        run: cargo run --target x86_64-pc-windows-msvc --release -- --version