diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 1eed6e5..863d5a9 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -19,17 +19,27 @@ jobs: with: fetch-depth: 1 submodules: recursive - - name: Install dependencies + + - name: Get ctr_firm_builder commit + run: echo "FIRM_BUILDER_COMMIT=$(git ls-remote https://github.com/derrekr/ctr_firm_builder.git HEAD | cut -f1)" >> $GITHUB_ENV + + - name: Cache ctr_firm_builder + id: cache-firm-builder + uses: actions/cache@v3 + with: + path: ctr_firm_builder + key: ${{ runner.os }}-${{ env.FIRM_BUILDER_COMMIT }} + + - name: Install ctr_firm_builder dependencies + if: steps.cache-firm-builder.outputs.cache-hit != 'true' run: | apt-get update apt-get -y install gcc - name: Build ctr_firm_builder - uses: actions/checkout@v3 - with: - repository: derrekr/ctr_firm_builder - path: ctr_firm_builder + if: steps.cache-firm-builder.outputs.cache-hit != 'true' run: | + git clone --depth 1 --recurse-submodules https://github.com/derrekr/ctr_firm_builder.git cd ctr_firm_builder make