xref: /DragonOS/.github/workflows/makefile.yml (revision 7b0ef10895108a0de5ff5ef3d2f93f40cf2e33a5)
1name: Build Check
2
3on:
4  push:
5    branches: [ "master", "feat-*", "fix-*"]
6  pull_request:
7    branches: [ "master", "feat-*", "fix-*"]
8
9jobs:
10
11  format-check:
12    name: Format check ${{ matrix.arch }}
13    runs-on: ubuntu-latest
14    continue-on-error: true
15    container: dragonos/dragonos-dev:v1.5
16
17    strategy:
18      matrix:
19        arch: [x86_64, riscv64]
20
21    steps:
22    - run: echo "Running in dragonos/dragonos-dev:v1.5"
23    - uses: actions/checkout@v3
24
25    - name: Format check
26      env:
27          ARCH: ${{ matrix.arch }}
28          HOME: /root
29      shell: bash -ileo pipefail {0}
30      run: |
31            printf "\n" >> kernel/src/include/bindings/bindings.rs
32            FMT_CHECK=1 make fmt
33
34  kernel-static-test:
35    name: Kernel static test ${{ matrix.arch }}
36    runs-on: ubuntu-latest
37    continue-on-error: true
38    container: dragonos/dragonos-dev:v1.5
39
40    strategy:
41      matrix:
42        arch: [x86_64, riscv64]
43
44    steps:
45    - run: echo "Running in dragonos/dragonos-dev:v1.5"
46
47    - uses: actions/checkout@v3
48
49    - name: Run kernel static test
50      shell: bash -ileo pipefail {0}
51      env:
52          ARCH: ${{ matrix.arch }}
53          HOME: /root
54      run: bash -c "source /root/.cargo/env && cd kernel && make test && make test-rbpf"
55
56  build-x86_64:
57
58    runs-on: ubuntu-latest
59    container: dragonos/dragonos-dev:v1.5
60
61    steps:
62    - run: echo "Running in dragonos/dragonos-dev:v1.5"
63
64    - uses: actions/checkout@v3
65    - name: build the DragonOS
66      env:
67          ARCH: x86_64
68          HOME: /root
69      shell: bash -ileo pipefail {0}
70
71      run: |
72        source ~/.bashrc
73        source ~/.cargo/env
74        export DragonOS_GCC=$HOME/opt/dragonos-gcc/gcc-x86_64-unknown-none/bin
75
76        make -j $(nproc)
77
78  build-riscv64:
79
80    runs-on: ubuntu-latest
81    container: dragonos/dragonos-dev:v1.5
82
83    steps:
84    - run: echo "Running in dragonos/dragonos-dev:v1.5"
85
86    - uses: actions/checkout@v3
87      with:
88        submodules: 'recursive'
89
90    - name: build the DragonOS
91      shell: bash -ileo pipefail {0}
92      env:
93          ARCH: riscv64
94          HOME: /root
95
96      run: source ~/.bashrc && source ~/.cargo/env && make kernel -j $(nproc)
97
98