From aa757d6f6e041af6dc308df723b7bb943e95286e Mon Sep 17 00:00:00 2001 From: shajen Date: Fri, 2 Feb 2024 23:44:13 +0100 Subject: [PATCH] Fixed CI cache. --- .github/workflows/main.yml | 25 +++++++++++++------------ Dockerfile | 5 ++++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bf56315..25ac136 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,6 +9,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Set up docker cache + uses: actions/cache@v3 + with: + path: cache + key: docker - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx @@ -29,16 +34,14 @@ jobs: load: true target: test tags: ${{ env.IMAGE }}:test - cache-from: | - type=registry,ref=${{ env.IMAGE }}:latest - type=registry,ref=${{ env.IMAGE }}:${{ github.ref_name }} + cache-from: type=local,src=cache + cache-to: type=local,dest=cache,mode=max - name: Build app uses: docker/build-push-action@v5 with: context: . - cache-from: | - type=registry,ref=${{ env.IMAGE }}:latest - type=registry,ref=${{ env.IMAGE }}:${{ github.ref_name }} + cache-from: type=local,src=cache + cache-to: type=local,dest=cache,mode=max - name: Run test run: | docker run --rm ${{ env.IMAGE }}:test @@ -50,8 +53,8 @@ jobs: push: true platforms: linux/arm/v7,linux/arm64/v8,linux/amd64 tags: ${{ env.IMAGE }}:${{ github.ref_name }} - cache-from: type=registry,ref=${{ env.IMAGE }}:${{ github.ref_name }} - cache-to: type=inline + cache-from: type=local,src=cache + cache-to: type=local,dest=cache,mode=max - name: Push release version if: ${{ github.ref_type == 'tag' }} uses: docker/build-push-action@v5 @@ -62,7 +65,5 @@ jobs: tags: | ${{ env.IMAGE }}:latest ${{ env.IMAGE }}:${{ github.ref_name }} - cache-from: | - type=registry,ref=${{ env.IMAGE }}:latest - type=registry,ref=${{ env.IMAGE }}:${{ github.ref_name }} - cache-to: type=inline + cache-from: type=local,src=cache + cache-to: type=local,dest=cache,mode=max diff --git a/Dockerfile b/Dockerfile index 0db4163..3bbd460 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,10 @@ RUN git clone --branch soapy-sdrplay3-0.4.2 https://github.com/pothosware/SoapyS cmake --install build WORKDIR /root/auto-sdr/ -COPY . . +COPY CMakeLists.txt CMakeLists.txt +COPY cmake cmake +COPY tests tests +COPY sources sources RUN cmake -B /root/auto-sdr/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-g" /root/auto-sdr && \ cmake --build /root/auto-sdr/build -j$(nproc) && \ mv /root/auto-sdr/build/auto_sdr /root/auto-sdr/build/auto_sdr.debug && \