Skip to content

Commit

Permalink
Fixed CI cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
shajen committed Nov 22, 2024
1 parent 9d8da34 commit aa757d6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down

0 comments on commit aa757d6

Please sign in to comment.