|
14 | 14 |
|
15 | 15 | env: |
16 | 16 | CARGO_TERM_COLOR: always |
| 17 | + RUSTFLAGS: "-Dwarnings" |
| 18 | + |
| 19 | +permissions: |
| 20 | + # For syyyr/rust-pycobertura-action |
| 21 | + pull-requests: write |
17 | 22 |
|
18 | 23 | jobs: |
19 | 24 | build: |
20 | 25 | strategy: |
| 26 | + fail-fast: false |
21 | 27 | matrix: |
22 | | - os: [ubuntu-latest] |
| 28 | + os: [ubuntu-latest, windows-latest] |
23 | 29 | toolchain: [stable, nightly] |
24 | 30 | include: |
25 | 31 | - os: ubuntu-latest |
26 | 32 | target: x86_64-unknown-linux-gnu |
| 33 | + - os: windows-latest |
| 34 | + target: x86_64-pc-windows-msvc |
27 | 35 | runs-on: ${{ matrix.os }} |
28 | 36 |
|
29 | 37 | steps: |
30 | 38 | - name: Checkout code |
31 | 39 | uses: actions/checkout@v4 |
32 | 40 |
|
33 | 41 | - name: Install system dependencies |
34 | | - run: sudo apt-get install -y libudev-dev pkg-config |
| 42 | + if: matrix.os == 'ubuntu-latest' |
| 43 | + run: | |
| 44 | + sudo apt-get update |
| 45 | + sudo apt-get install -y libudev-dev pkg-config |
35 | 46 |
|
36 | 47 | - name: Set up Rust |
37 | 48 | uses: actions-rust-lang/setup-rust-toolchain@v1 |
38 | 49 | with: |
39 | 50 | target: ${{ matrix.target }} |
40 | 51 | toolchain: ${{ matrix.toolchain }} |
| 52 | + components: clippy |
41 | 53 | override: true |
42 | 54 |
|
| 55 | + - name: Clippy |
| 56 | + run: cargo clippy --all-targets --all-features |
| 57 | + - name: Build |
| 58 | + run: cargo build --all-targets --all-features |
| 59 | + - name: Run tests |
| 60 | + run: cargo test --all-targets --all-features |
| 61 | + |
43 | 62 | - name: Build and Install Binary |
44 | 63 | run: | |
45 | 64 | mkdir -p ${{github.workspace}}/install |
46 | | - cargo install --path '${{github.workspace}}' --root '${{github.workspace}}/install' --target ${{ matrix.target }} --locked |
| 65 | + cargo install --all-features --path '${{github.workspace}}' --root '${{github.workspace}}/install' --target ${{ matrix.target }} --locked |
47 | 66 | shell: bash |
48 | 67 |
|
49 | 68 | - name: Upload Artifact |
|
84 | 103 | runs-on: ubuntu-latest |
85 | 104 | steps: |
86 | 105 | - name: Install system dependencies |
87 | | - run: sudo apt-get install -y libudev-dev pkg-config |
| 106 | + run: | |
| 107 | + sudo apt-get update |
| 108 | + sudo apt-get install -y libudev-dev pkg-config |
88 | 109 |
|
89 | 110 | - name: Generate coverage |
90 | 111 | uses: silicon-heaven/rust-pycobertura-action@v2.0.0 |
|
0 commit comments