File: rust.yml

package info (click to toggle)
rust-ppmd-rust 1.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 364 kB
  • sloc: makefile: 4
file content (108 lines) | stat: -rw-r--r-- 3,180 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
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
name: Rust

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    runs-on: ${{matrix.os}}
    strategy:
      matrix:
        os:
          - macos-latest
          - ubuntu-latest
          - windows-latest
        toolchain:
          - stable
          - 1.82.0 # MSRV
        include:
          - os: macos-latest
            target: x86_64-apple-darwin
          - os: ubuntu-latest
            target: x86_64-unknown-linux-gnu
          - os: windows-latest
            target: x86_64-pc-windows-msvc
    steps:
      - uses: actions/checkout@v4
      - name: Install rust version
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{matrix.toolchain}}
          target: ${{matrix.target}}
      - uses: actions/checkout@v4
      - name: Build (default)
        run: cargo build --workspace
      - name: Run tests (default)
        run: cargo test --workspace
      - name: Build (unstable-tagged-offsets)
        run: cargo build --workspace --features unstable-tagged-offsets
      - name: Run tests (unstable-tagged-offsets)
        run: cargo test --workspace --features unstable-tagged-offsets

  build-wasm:
    runs-on: ${{matrix.os}}
    strategy:
      matrix:
        os:
          - ubuntu-latest
        toolchain:
          - stable
          - 1.82.0 # MSRV
        include:
          - os: ubuntu-latest
            target: wasm32-unknown-unknown
    steps:
      - uses: actions/checkout@v4
      - name: Install rust version
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{matrix.toolchain}}
          target: ${{matrix.target}}
      - uses: actions/checkout@v4
      - name: Build (default)
        run: cargo build --target wasm32-unknown-unknown
      - name: Build (unstable-tagged-offsets)
        run: cargo build --target wasm32-unknown-unknown --features unstable-tagged-offsets

  rustfmt:
    name: Rustfmt
    runs-on: ubuntu-24.04
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Setup Rust toolchain
        uses: dtolnay/rust-toolchain@v1
        with:
          toolchain: nightly
          components: rustfmt
      - name: Cache build artifacts
        uses: Swatinem/rust-cache@v2.8.0
      - name: Check code formatted
        run: cargo fmt --all -- --check

  clippy:
    name: Clippy
    runs-on: ubuntu-24.04
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Setup Rust toolchain
        uses: dtolnay/rust-toolchain@v1
        with:
          toolchain: stable
          components: clippy
      - name: Cache build artifacts
        uses: Swatinem/rust-cache@v2.8.0

      - name: Check no lint warnings
        run: cargo clippy --workspace -- -D warnings
      - name: Check no lint warnings (all features)
        run: cargo clippy --workspace --all-features -- -D warnings
      - name: Check no lint warnings (no default features)
        run: cargo clippy --workspace --no-default-features -- -D warnings