• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: CI
2
3on:
4  push:
5    branches: [master]
6  pull_request:
7
8jobs:
9  check:
10    runs-on: ubuntu-latest
11    steps:
12      - uses: actions/checkout@v4
13      - name: Check code format
14        uses: actions-rs/cargo@v1
15        with:
16          command: fmt
17          args: --all -- --check
18      - name: Clippy
19        uses: actions-rs/clippy-check@v1
20        with:
21          token: ${{ secrets.GITHUB_TOKEN }}
22
23  build:
24    runs-on: ubuntu-latest
25    steps:
26      - uses: actions/checkout@v4
27      - name: Build with no features
28        uses: actions-rs/cargo@v1
29        with:
30          command: build
31          args: --no-default-features
32      - name: Build with all features
33        uses: actions-rs/cargo@v1
34        with:
35          command: build
36          args: --all-features
37      - name: Docs
38        uses: actions-rs/cargo@v1
39        with:
40          command: doc
41      - name: Test with no features
42        uses: actions-rs/cargo@v1
43        with:
44          command: test
45          args: --no-default-features
46      - name: Test with all features
47        uses: actions-rs/cargo@v1
48        with:
49          command: test
50          args: --all-features
51
52  examples:
53    runs-on: ubuntu-22.04
54    strategy:
55      fail-fast: false
56      matrix:
57        example:
58          - aarch64
59          - riscv
60          - x86_64
61        include:
62          - example: aarch64
63            packages: qemu-system-arm gcc-aarch64-linux-gnu
64          - example: riscv
65            packages: qemu-system-misc
66          - example: x86_64
67            packages: qemu-system-x86
68    steps:
69      - uses: actions/checkout@v4
70      - name: Install QEMU
71        run: sudo apt update && sudo apt install ${{ matrix.packages }} && sudo chmod 666 /dev/vhost-vsock
72      - name: Check code format
73        working-directory: examples/${{ matrix.example }}
74        run: cargo fmt --all -- --check
75      - name: Build
76        working-directory: examples/${{ matrix.example }}
77        run: make kernel
78      - name: Run
79        working-directory: examples/${{ matrix.example }}
80        run: QEMU_ARGS="-display none" make qemu accel="off"
81