Skip to content

Commit ca2d072

Browse files
committed
Improve CI
1 parent 88d3713 commit ca2d072

1 file changed

Lines changed: 25 additions & 4 deletions

File tree

.github/workflows/rust.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,55 @@ on:
1414

1515
env:
1616
CARGO_TERM_COLOR: always
17+
RUSTFLAGS: "-Dwarnings"
18+
19+
permissions:
20+
# For syyyr/rust-pycobertura-action
21+
pull-requests: write
1722

1823
jobs:
1924
build:
2025
strategy:
26+
fail-fast: false
2127
matrix:
22-
os: [ubuntu-latest]
28+
os: [ubuntu-latest, windows-latest]
2329
toolchain: [stable, nightly]
2430
include:
2531
- os: ubuntu-latest
2632
target: x86_64-unknown-linux-gnu
33+
- os: windows-latest
34+
target: x86_64-pc-windows-msvc
2735
runs-on: ${{ matrix.os }}
2836

2937
steps:
3038
- name: Checkout code
3139
uses: actions/checkout@v4
3240

3341
- 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
3546
3647
- name: Set up Rust
3748
uses: actions-rust-lang/setup-rust-toolchain@v1
3849
with:
3950
target: ${{ matrix.target }}
4051
toolchain: ${{ matrix.toolchain }}
52+
components: clippy
4153
override: true
4254

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+
4362
- name: Build and Install Binary
4463
run: |
4564
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
4766
shell: bash
4867

4968
- name: Upload Artifact
@@ -84,7 +103,9 @@ jobs:
84103
runs-on: ubuntu-latest
85104
steps:
86105
- 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
88109
89110
- name: Generate coverage
90111
uses: silicon-heaven/rust-pycobertura-action@v2.0.0

0 commit comments

Comments
 (0)