Debian Codegraph @

.github/workflows/checks.yml

raw symbols SCIP
1 name: Checks
2
3 on:
4 push:
5 branches: [ "main" ]
6 pull_request:
7 branches: [ "main" ]
8
9 env:
10 CARGO_TERM_COLOR: always
11
12 jobs:
13 # Taken from rust-lang/libz-sys CI/CD example.
14 #
15 # This job downloads and stores `cross` as an artifact, so that it can be
16 # redownloaded across all of the jobs.
17 install-cross:
18 runs-on: ubuntu-latest
19 steps:
20 - uses: XAMPPRocky/get-github-release@v1
21 id: cross
22 with:
23 owner: cross-rs
24 repo: cross
25 matches: ${{ matrix.platform }}
26 token: ${{ secrets.GITHUB_TOKEN }}
27 - uses: actions/upload-artifact@v4
28 with:
29 name: cross-${{ matrix.platform }}
30 path: ${{ steps.cross.outputs.install_path }}
31 strategy:
32 matrix:
33 platform: [linux-musl]
34
35 # Build and run unit tests
36 build:
37 runs-on: ubuntu-latest
38 steps:
39 - uses: actions/checkout@v4
40 - uses: actions-rs/toolchain@v1
41 with:
42 profile: minimal
43 toolchain: stable
44 override: true
45 - name: Build
46 run: cargo build --verbose
47 - name: Install request-key for Request/Instantiate flow
48 run: |
49 cargo build --example request-key --features std
50 sudo mv ./target/debug/examples/request-key /sbin/request-key
51 - name: Run tests
52 run: cargo test --verbose -- --include-ignored
53
54 # Ensure clippy and formatting pass
55 clippy:
56 runs-on: ubuntu-latest
57 steps:
58 - uses: actions/checkout@v4
59 - uses: actions-rs/toolchain@v1
60 with:
61 profile: minimal
62 toolchain: stable
63 override: true
64 components: clippy
65 - name: Run Clippy
66 run: cargo clippy --verbose -- --deny "warnings"
67 - name: Run RustFmt
68 run: cargo fmt -- --check
69
70 # Cross compile for multiple architectures.
71 #
72 # Cannot run the unit tests until we can specify a seccomp profile for cross'
73 # docker images. Since the default seccomp profile blocks keyctl calls.
74 cross-linux:
75 runs-on: ubuntu-latest
76 needs: install-cross
77 steps:
78 - uses: actions/checkout@v4
79 with:
80 submodules: 'recursive'
81 - uses: dtolnay/rust-toolchain@stable
82 with:
83 toolchain: stable
84 - name: Download Cross
85 uses: actions/download-artifact@v4
86 with:
87 name: cross-linux-musl
88 path: /tmp
89 - run: rustup toolchain install ${{ matrix.channel }}
90 - run: chmod +x /tmp/cross
91 - name: Build
92 run: /tmp/cross build --all-features --target ${{ matrix.target }}
93 strategy:
94 fail-fast: false
95 matrix:
96 channel: [stable]
97 target:
98 - aarch64-unknown-linux-musl
99 - arm-unknown-linux-musleabihf
100 - i686-unknown-linux-musl
101 - x86_64-unknown-linux-musl
102 - x86_64-unknown-linux-gnu
103
104
105 # Run miri (commented out since miri doesn't support the keyctl
106 # syscalls)
107 #miri:
108 # name: "miri"
109 # runs-on: ubuntu-latest
110 # steps:
111 # - uses: actions/checkout@v3
112 # - uses: actions-rs/toolchain@v1
113 # with:
114 # profile: minimal
115 # toolchain: nightly
116 # override: true
117 # components: miri
118 # - name: Setup Miri
119 # run: cargo +nightly miri setup
120 # - name: Test with Miri
121 # run: cargo +nightly miri test