about summary refs log tree commit diff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build-test-push-container.yaml (renamed from .github/workflows/build-push-test-container.yaml)61
-rw-r--r--.github/workflows/codeql-analysis.yml6
2 files changed, 51 insertions, 16 deletions
diff --git a/.github/workflows/build-push-test-container.yaml b/.github/workflows/build-test-push-container.yaml
index e2b828ac..5d9e69e4 100644
--- a/.github/workflows/build-push-test-container.yaml
+++ b/.github/workflows/build-test-push-container.yaml
@@ -1,5 +1,4 @@
-name: Build, test and push container image
-
+name: Build and test container image
 on:
   push:
     branches:
@@ -7,49 +6,83 @@ on:
       - dev
     tags:
       - '*'
+  pull_request:
+    branch:
+      - stable
+      - dev
 
 jobs:
-  build:
-    name: Build, test and push container image
+  build-amd64:
+    name: Build and test amd64
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3
-      - name: Set up QEMU
-        uses: docker/setup-qemu-action@v2
-        with:
-          platforms: arm64
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v2
-      - name: Build amd64 image
+      - name: Build amd64
         uses: docker/build-push-action@v3
         with:
           context: .
           platforms: linux/amd64
           load: true
           tags: aflplusplus/aflplusplus:test
-      - name: Build arm64 image
+          # cache-from: type=gha  # Ensure we always build a fresh image. We just use the cache for the subsequent push job.
+          cache-to: type=gha,mode=max
+      - name: Test linux/amd64 image
+        run: docker run --rm --platform linux/amd64 aflplusplus/aflplusplus:test make tests
+        continue-on-error: true
+  build-arm64:
+    name: Build and test arm64
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v3
+      - name: Set up QEMU
+        uses: docker/setup-qemu-action@v2
+        with:
+          platforms: arm64
+      - name: Set up Docker Buildx
+        uses: docker/setup-buildx-action@v2
+      - name: Build arm64
         uses: docker/build-push-action@v3
         with:
           context: .
           platforms: linux/arm64
           load: true
           tags: aflplusplus/aflplusplus:test
-      - name: Test linux/amd64 image
-        run: docker run --rm --platform linux/amd64 aflplusplus/aflplusplus:test make tests
+          # cache-from: type=gha  # Ensure we always build a fresh image. We just use the cache for the subsequent push job.
+          cache-to: type=gha,mode=max
       - name: Test linux/arm64 image
         run: docker run --rm --platform linux/arm64 aflplusplus/aflplusplus:test make tests
+        continue-on-error: true
+  push:
+    needs:
+      - build-amd64
+      - build-arm64
+    if: ${{ github.event_name == 'push' }}
+    name: Push image
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v3
+      - name: Set up QEMU
+        uses: docker/setup-qemu-action@v2
+        with:
+          platforms: arm64
+      - name: Set up Docker Buildx
+        uses: docker/setup-buildx-action@v2
       - name: Login to Dockerhub
         uses: docker/login-action@v2
         with:
           username: ${{ secrets.DOCKER_USERNAME }}
           password: ${{ secrets.DOCKER_TOKEN }}
-      - name: Publish ${{ github.ref_name }} to docker.io registry
+      - name: Publish ${{ github.ref_name }} for amd64 and arm64 to docker.io registry
         uses: docker/build-push-action@v3
         with:
           context: .
           platforms: linux/amd64,linux/arm64
           push: true
           tags: aflplusplus/aflplusplus:${{ github.ref_name }}
+          cache-from: type=gha
+          # cache-to: type=gha,mode=max  # No need to add to cache as we'll never use this
         if: ${{ github.ref_name != 'stable' }}
       - name: Publish stable and latest to docker.io registry
         uses: docker/build-push-action@v3
@@ -58,4 +91,6 @@ jobs:
           platforms: linux/amd64,linux/arm64
           push: true
           tags: aflplusplus/aflplusplus:${{ github.ref_name }},aflplusplus/aflplusplus:latest
+          cache-from: type=gha
+          # cache-to: type=gha,mode=max  # No need to add to cache as we'll never use this
         if: ${{ github.ref_name == 'stable' }}
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index d5dce05f..55d477fc 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -21,12 +21,12 @@ jobs:
       uses: actions/checkout@v3
 
     - name: Initialize CodeQL
-      uses: github/codeql-action/init@v1
+      uses: github/codeql-action/init@v2
       with:
         languages: ${{ matrix.language }}
 
     - name: Autobuild
-      uses: github/codeql-action/autobuild@v1
+      uses: github/codeql-action/autobuild@v2
 
     - name: Perform CodeQL Analysis
-      uses: github/codeql-action/analyze@v1
+      uses: github/codeql-action/analyze@v2