1name: Build Check 2 3on: 4 push: 5 branches: [ "master" ] 6 pull_request: 7 branches: [ "master" ] 8 9jobs: 10 # ensure the toolchain is cached 11 ensure-toolchain: 12 uses: ./.github/workflows/cache-toolchain.yml 13 14 build: 15 16 runs-on: ubuntu-latest 17 needs: [ensure-toolchain] 18 19 steps: 20 - uses: actions/checkout@v3 21 22 - name: Cache DragonOS GCC 23 id: cache-dragonos-gcc 24 uses: actions/cache@v3 25 env: 26 cache-name: cache-dragonos-gcc 27 with: 28 path: | 29 ~/opt 30 key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('tools/build_gcc_toolchain.sh') }} 31 32 - name: Cache build tools 33 id: cache-build-tools 34 uses: actions/cache@v3 35 env: 36 cache-name: cache-build-tools 37 dadk_version: 0.1.2 38 with: 39 path: | 40 ~/.cargo 41 ~/.rustup 42 ~/.bashrc 43 key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.dadk_version }}-${{ hashFiles('.github/workflows/cache-toolchain.yml') }} 44 45 - name: Format check 46 run: | 47 printf "\n" >> kernel/src/include/bindings/bindings.rs 48 printf "\n" >> user/libs/libc/src/include/internal/bindings/bindings.rs 49 FMT_CHECK=1 make fmt 50 51 - name: build the DragonOS 52 run: bash -c "source ~/.cargo/env && export DragonOS_GCC=$HOME/opt/dragonos-gcc/gcc-x86_64-unknown-none/bin && make -j $(nproc) " 53 54 - name: Run kernel static test 55 run: bash -c "source ~/.cargo/env && cd kernel && make test" 56