1name: Rust format check 2 3on: [push, pull_request] 4 5jobs: 6 # ensure the toolchain is cached 7 ensure-toolchain: 8 uses: ./.github/workflows/cache-toolchain.yml 9 10 fmt: 11 name: check 12 runs-on: ubuntu-latest 13 needs: [ensure-toolchain] 14 steps: 15 - uses: actions/checkout@v3 16 - name: Cache build tools 17 id: dragon-boot-cache-build-tools 18 uses: actions/cache@v3 19 env: 20 cache-name: dragon-boot-cache-build-tools 21 with: 22 path: | 23 ~/.cargo 24 ~/.rustup 25 ~/.bashrc 26 key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('.github/workflows/cache-toolchain.yml') }} 27 28 - name: Check format 29 run: | 30 FMT_CHECK=1 make fmt 31