]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Run workflows on pull requests 1687/head
authorChristian König <ckoenig@posteo.de>
Fri, 9 Jun 2023 17:55:36 +0000 (19:55 +0200)
committerChristian König <ckoenig@posteo.de>
Fri, 9 Jun 2023 20:43:22 +0000 (22:43 +0200)
Signed-off-by: Christian König <ckoenig@posteo.de>
.github/workflows/check_ap2_systemd_basic.yml
.github/workflows/check_ap2_systemd_full.yml
.github/workflows/check_ap2_systemd_full_build_folder.yml
.github/workflows/check_ap2_systemv_full.yml
.github/workflows/check_classic_mac_basic.yml
.github/workflows/check_classic_systemd_basic.yml
.github/workflows/check_classic_systemd_full.yml
.github/workflows/docker-build-on-push_and_pull_request.yaml [moved from .github/workflows/docker-build-on-push.yaml with 60% similarity]

index cb1ecdc804de761cc5a586b4e93845095bf07e09..23e155beeb77ec225ae96b1d6a78a3ae2c7c0d27 100644 (file)
@@ -3,6 +3,8 @@ name: Basic ALSA configuration for systemd, using a build folder.
 on:
   push:
     branches: [ "development" ]
+  pull_request:
+    types: [opened, synchronize, reopened, ready_for_review]
 
 jobs:
   build:
index 94239fe0d0ca7634a76be960de07e5119ddc1638..e99e0a23282c3ee142c4e6cf08d2803fe6f6588a 100644 (file)
@@ -3,7 +3,9 @@ name: Full configuration (but without apple-alac) for systemd.
 on:
   push:
     branches: [ "development", "danger" ]
-
+  pull_request:
+    types: [opened, synchronize, reopened, ready_for_review]
+    
 jobs:
   build:
 
index cad5bbe4043776f1e172ab3109e39d62e8561edb..bdab8195f71bcfd4ef4c892848cfa4765cfb8272 100644 (file)
@@ -3,6 +3,8 @@ name: Full configuration (but without apple-alac) for systemd, using a build fol
 on:
   push:
     branches: [ "development" ]
+  pull_request:
+    types: [opened, synchronize, reopened, ready_for_review]
 
 jobs:
   build:
index 4e5144308c19b9f2ff7945164f05723ddcfa3791..1f8dab0737b22dbb38d82d4eab8cdc30fd2529fc 100644 (file)
@@ -3,7 +3,9 @@ name: Full configuration (but without apple-alac) for a System V system.
 on:
   push:
     branches: [ "development" ]
-
+  pull_request:
+    types: [opened, synchronize, reopened, ready_for_review]
+    
 jobs:
   build:
 
index f53de4a2204a31db0773dfba3853cf1fa25a2690..b06e046a2f0c0d0dc900d112fb51960de9b848e8 100644 (file)
@@ -3,7 +3,9 @@ name: Basic libao configuration for macOS with BREW -- classic only, because mac
 on:
   push:
     branches: [ "development", "danger" ]
-
+  pull_request:
+    types: [opened, synchronize, reopened, ready_for_review]
+    
 jobs:
   build:
 
index 825254848d4d7681ae4264f4435f4eed4c9674eb..95f9d9049d909342632d0b613a40747405f1fa45 100644 (file)
@@ -3,7 +3,9 @@ name: Basic ALSA classic configuration for systemd, using a build folder.
 on:
   push:
     branches: [ "development" ]
-
+  pull_request:
+    types: [opened, synchronize, reopened, ready_for_review]
+    
 jobs:
   build:
 
index 57bb7ac5f400cf664d9b3e3efeac3bd8b58c3089..75229469b6ac0ae47919c1c4a15e5c1b39b9bc60 100644 (file)
@@ -3,6 +3,8 @@ name: Full classic configuration (but without apple-alac) for systemd, using a b
 on:
   push:
     branches: [ "development", "danger" ]
+  pull_request:
+    types: [opened, synchronize, reopened, ready_for_review]
 
 jobs:
   build:
similarity index 60%
rename from .github/workflows/docker-build-on-push.yaml
rename to .github/workflows/docker-build-on-push_and_pull_request.yaml
index 79ac8eac2190cf503519d3793098b93829b16fba..fdbeb8106c03ab3236f4a230eedf2f1be735aa5d 100644 (file)
@@ -4,20 +4,65 @@
 # 'master'      - rolling, rolling-classic
 # 'development' - development, development-classic
 
-name: Build and push docker (commit)
+name: Build and push docker (push/pull request)
 
 on:
   push:
     branches:
       - master
       - development
+  pull_request:
+    types: [opened, synchronize, reopened, ready_for_review]
 
 env:
   DOCKER_PLATFORMS: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
   NQPTP_BRANCH: main
 
 jobs:
-  main:
+  test-build-on-pull-request:
+    if: github.event_name == 'pull_request'
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Repo
+        uses: actions/checkout@v3
+        with:
+          fetch-depth: 0
+          ref: ${{github.event.pull_request.head.ref}}
+          repository: ${{github.event.pull_request.head.repo.full_name}}
+  
+      - name: Set SHAIRPORT_SYNC_BRANCH env
+        run: |
+          SHAIRPORT_SYNC_BRANCH=$(git rev-parse --abbrev-ref HEAD)
+          echo "Current SHAIRPORT_SYNC_BRANCH set to ${SHAIRPORT_SYNC_BRANCH}"
+          echo "SHAIRPORT_SYNC_BRANCH=${SHAIRPORT_SYNC_BRANCH}" >> $GITHUB_ENV
+
+      - name: Set up QEMU
+        uses: docker/setup-qemu-action@v2.1.0
+
+      - name: Set up Docker Buildx
+        uses: docker/setup-buildx-action@v2.5.0
+
+      - name: Build (classic)
+        uses: docker/build-push-action@v4.0.0
+        with:
+          context: ./
+          file: ./docker/classic/Dockerfile
+          push: false
+          build-args: |
+            SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }}
+      - name: Build
+        uses: docker/build-push-action@v4.0.0
+        with:
+          context: ./
+          file: ./docker/Dockerfile
+          push: false
+          build-args: |
+            SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }}
+            NQPTP_BRANCH=${{ env.NQPTP_BRANCH }}
+
+  build-and-publish:
+    if: github.event_name != 'pull_request'
     runs-on: ubuntu-latest
     steps:
       - name: Checkout