| 1 | name: udev |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - main |
| 7 | pull_request: |
| 8 | branches: |
| 9 | - main |
| 10 | |
| 11 | jobs: |
| 12 | rustfmt-clippy: |
| 13 | runs-on: ubuntu-latest |
| 14 | |
| 15 | steps: |
| 16 | - uses: actions/checkout@v3 |
| 17 | |
| 18 | - name: Install stable |
| 19 | uses: actions-rs/toolchain@v1 |
| 20 | with: |
| 21 | profile: minimal |
| 22 | toolchain: stable |
| 23 | components: rustfmt, clippy |
| 24 | |
| 25 | - name: Run rustfmt |
| 26 | uses: actions-rs/cargo@v1 |
| 27 | with: |
| 28 | command: fmt |
| 29 | args: -- --check |
| 30 | |
| 31 | - name: Run clippy |
| 32 | uses: actions-rs/cargo@v1 |
| 33 | with: |
| 34 | command: clippy |
| 35 | args: --tests |
| 36 | |
| 37 | build: |
| 38 | runs-on: ubuntu-latest |
| 39 | strategy: |
| 40 | matrix: |
| 41 | arch: [x86_64] |
| 42 | target: [x86_64-unknown-linux-gnu, i586-unknown-linux-gnu, i686-unknown-linux-gnu] |
| 43 | steps: |
| 44 | - uses: actions/checkout@v3 |
| 45 | |
| 46 | - name: Setup latest Alpine Linux |
| 47 | uses: jirutka/setup-alpine@v1 |
| 48 | with: |
| 49 | arch: ${{ matrix.arch }} |
| 50 | branch: latest-stable |
| 51 | packages: build-base pkgconf lld rustup |
| 52 | |
| 53 | - name: Install Rust stable toolchain via rustup |
| 54 | run: rustup-init --target ${{ matrix.target }} --default-toolchain stable --profile minimal -y |
| 55 | shell: alpine.sh {0} |
| 56 | |
| 57 | - name: Build (debug) |
| 58 | run: cargo build --target ${{ matrix.target }} |
| 59 | shell: alpine.sh {0} |
| 60 | |
| 61 | - name: Build (release) |
| 62 | run: cargo build --release --target ${{ matrix.target }} |
| 63 | shell: alpine.sh {0} |
| 64 | |
| 65 | test: |
| 66 | runs-on: ubuntu-latest |
| 67 | strategy: |
| 68 | matrix: |
| 69 | arch: [x86_64] |
| 70 | target: [x86_64-unknown-linux-gnu] |
| 71 | steps: |
| 72 | - uses: actions/checkout@v3 |
| 73 | |
| 74 | - name: Install stable |
| 75 | uses: actions-rs/toolchain@v1 |
| 76 | with: |
| 77 | profile: minimal |
| 78 | toolchain: stable |
| 79 | |
| 80 | - name: Run all the tests (debug) |
| 81 | run: cargo test --all --target ${{ matrix.target }} |
| 82 | |
| 83 | - name: Run all the tests (release) |
| 84 | run: cargo test --all --release --target ${{ matrix.target }} |