• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: CI
2
3on:
4  push:
5    branches:
6      - main
7  pull_request:
8
9jobs:
10  check:
11    name: Check
12    runs-on: ubuntu-latest
13    strategy:
14      matrix:
15        rust: [stable, nightly, 1.48]
16
17    env:
18      RUSTFLAGS: -D warnings
19    steps:
20    - uses: actions/checkout@v3
21    - run: |
22        rustup set profile minimal
23        rustup install ${{ matrix.rust }}
24        rustup default ${{ matrix.rust }}
25
26        cargo check --features "netlink"
27        cargo check --no-default-features --features "std netlink"
28        cargo check --no-default-features --features "no_std netlink"
29        cargo check --no-default-features --features "no_std general errno"
30
31  test:
32    name: Test
33    runs-on: ubuntu-latest
34    env:
35      # -D warnings is commented out in our install-rust action; re-add it here.
36      RUSTFLAGS: -D warnings
37    steps:
38    - uses: actions/checkout@v3
39      with:
40        submodules: true
41    - uses: ./.github/actions/install-rust
42      with:
43        toolchain: stable
44
45    - run: >
46        rustup target add
47        x86_64-unknown-linux-musl
48        x86_64-unknown-linux-gnux32
49        i686-unknown-linux-gnu
50        i686-unknown-linux-musl
51        riscv64gc-unknown-linux-gnu
52        aarch64-unknown-linux-gnu
53        aarch64-unknown-linux-musl
54        powerpc64le-unknown-linux-gnu
55        armv5te-unknown-linux-gnueabi
56        mipsel-unknown-linux-gnu
57        mips64el-unknown-linux-gnuabi64
58    - run: cargo check --tests -vv
59    - run: cargo check --tests -vv --target=x86_64-unknown-linux-musl
60    - run: cargo check --tests -vv --target=x86_64-unknown-linux-gnux32
61    - run: cargo check --tests -vv --target=i686-unknown-linux-gnu
62    - run: cargo check --tests -vv --target=i686-unknown-linux-musl
63    - run: cargo check --tests -vv --target=riscv64gc-unknown-linux-gnu
64    - run: cargo check --tests -vv --target=aarch64-unknown-linux-gnu
65    - run: cargo check --tests -vv --target=aarch64-unknown-linux-musl
66    - run: cargo check --tests -vv --target=powerpc64le-unknown-linux-gnu
67    - run: cargo check --tests -vv --target=armv5te-unknown-linux-gnueabi
68    - run: cargo check --tests -vv --target=mipsel-unknown-linux-gnu
69    - run: cargo check --tests -vv --target=mips64el-unknown-linux-gnuabi64
70
71  gen:
72    name: Update generated files
73    runs-on: ubuntu-latest
74    steps:
75    - uses: actions/checkout@v3
76    - run: |
77        sudo apt install libclang-dev
78        cd gen && cargo run --release
79        git diff --exit-code
80