• 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@v2
13      - uses: actions-rs/toolchain@v1
14        with:
15          profile: minimal
16          toolchain: stable
17          components: rustfmt, clippy
18      - name: Check code format
19        uses: actions-rs/cargo@v1
20        with:
21          command: fmt
22          args: --all -- --check
23      - name: Clippy
24        uses: actions-rs/clippy-check@v1
25        with:
26          token: ${{ secrets.GITHUB_TOKEN }}
27
28  build:
29    runs-on: ubuntu-latest
30    steps:
31      - uses: actions/checkout@v2
32      - uses: actions-rs/toolchain@v1
33        with:
34          profile: minimal
35          toolchain: stable
36      - name: Build with no features
37        uses: actions-rs/cargo@v1
38        with:
39          command: build
40          args: --no-default-features
41      - name: Build with all features
42        uses: actions-rs/cargo@v1
43        with:
44          command: build
45          args: --all-features
46      - name: Docs
47        uses: actions-rs/cargo@v1
48        with:
49          command: doc
50      - name: Test with no features
51        uses: actions-rs/cargo@v1
52        with:
53          command: test
54          args: --no-default-features
55      - name: Test with all features
56        uses: actions-rs/cargo@v1
57        with:
58          command: test
59          args: --all-features
60
61  examples:
62    runs-on: ubuntu-22.04
63    strategy:
64      fail-fast: false
65      matrix:
66        example:
67          - aarch64
68          - riscv
69        include:
70          - example: aarch64
71            toolchain: stable
72            target: aarch64-unknown-none
73            packages: qemu-system-arm gcc-aarch64-linux-gnu
74          - example: riscv
75            toolchain: nightly-2022-11-03
76            target: riscv64imac-unknown-none-elf
77            packages: qemu-system-misc
78    steps:
79      - uses: actions/checkout@v2
80      - name: Install QEMU
81        run: sudo apt update && sudo apt install ${{ matrix.packages }} && sudo chmod 666 /dev/vhost-vsock
82      - uses: actions-rs/toolchain@v1
83        with:
84          profile: minimal
85          toolchain: ${{ matrix.toolchain }}
86          target: ${{ matrix.target }}
87          components: llvm-tools-preview, rustfmt
88      - name: Check code format
89        working-directory: examples/${{ matrix.example }}
90        run: cargo fmt --all -- --check
91      - name: Build
92        working-directory: examples/${{ matrix.example }}
93        run: make kernel
94      - name: Run
95        working-directory: examples/${{ matrix.example }}
96        run: QEMU_ARGS="-display none" make qemu
97