xref: /DragonReach/.github/workflows/standard-check.yml (revision 236b9b4f4d4f527c482cad40d09674195023e5fb)
1*236b9b4fSLoGinname: Standard Check
2*236b9b4fSLoGin
3*236b9b4fSLoGinon: [push, pull_request]
4*236b9b4fSLoGin
5*236b9b4fSLoGinjobs:
6*236b9b4fSLoGin    # ensure the toolchain is cached
7*236b9b4fSLoGin    ensure-toolchain:
8*236b9b4fSLoGin        uses: ./.github/workflows/cache-toolchain.yml
9*236b9b4fSLoGin
10*236b9b4fSLoGin    fmt:
11*236b9b4fSLoGin        name: fmt check
12*236b9b4fSLoGin        runs-on: ubuntu-latest
13*236b9b4fSLoGin        needs: [ensure-toolchain]
14*236b9b4fSLoGin        steps:
15*236b9b4fSLoGin            - uses: actions/checkout@v3
16*236b9b4fSLoGin            - name: Cache build tools
17*236b9b4fSLoGin              id: cache-build-tools
18*236b9b4fSLoGin              uses: actions/cache@v3
19*236b9b4fSLoGin              env:
20*236b9b4fSLoGin                  cache-name: cache-build-tools
21*236b9b4fSLoGin                  dadk_version: 0.1.2
22*236b9b4fSLoGin              with:
23*236b9b4fSLoGin                path: |
24*236b9b4fSLoGin                  ~/.cargo
25*236b9b4fSLoGin                  ~/.rustup
26*236b9b4fSLoGin                  ~/.bashrc
27*236b9b4fSLoGin                key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.dadk_version }}-${{ hashFiles('.github/workflows/cache-toolchain.yml') }}
28*236b9b4fSLoGin
29*236b9b4fSLoGin            - name: Check format
30*236b9b4fSLoGin              run: |
31*236b9b4fSLoGin                    make fmt-check
32*236b9b4fSLoGin
33*236b9b4fSLoGin    build:
34*236b9b4fSLoGin      name: build check
35*236b9b4fSLoGin      runs-on: ubuntu-latest
36*236b9b4fSLoGin      needs: [ensure-toolchain]
37*236b9b4fSLoGin      steps:
38*236b9b4fSLoGin          - uses: actions/checkout@v3
39*236b9b4fSLoGin          - name: Cache build tools
40*236b9b4fSLoGin            id: cache-build-tools
41*236b9b4fSLoGin            uses: actions/cache@v3
42*236b9b4fSLoGin            env:
43*236b9b4fSLoGin                cache-name: cache-build-tools
44*236b9b4fSLoGin                dadk_version: 0.1.2
45*236b9b4fSLoGin            with:
46*236b9b4fSLoGin              path: |
47*236b9b4fSLoGin                ~/.cargo
48*236b9b4fSLoGin                ~/.rustup
49*236b9b4fSLoGin                ~/.bashrc
50*236b9b4fSLoGin              key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.dadk_version }}-${{ hashFiles('.github/workflows/cache-toolchain.yml') }}
51*236b9b4fSLoGin
52*236b9b4fSLoGin          - name: Build check
53*236b9b4fSLoGin            run: |
54*236b9b4fSLoGin                  make all -j $(nproc)
55