From: Christian König Date: Fri, 9 Jun 2023 17:55:36 +0000 (+0200) Subject: Run workflows on pull requests X-Git-Tag: 4.3~1^2~54^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1687%2Fhead;p=thirdparty%2Fshairport-sync.git Run workflows on pull requests Signed-off-by: Christian König --- diff --git a/.github/workflows/check_ap2_systemd_basic.yml b/.github/workflows/check_ap2_systemd_basic.yml index cb1ecdc8..23e155be 100644 --- a/.github/workflows/check_ap2_systemd_basic.yml +++ b/.github/workflows/check_ap2_systemd_basic.yml @@ -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: diff --git a/.github/workflows/check_ap2_systemd_full.yml b/.github/workflows/check_ap2_systemd_full.yml index 94239fe0..e99e0a23 100644 --- a/.github/workflows/check_ap2_systemd_full.yml +++ b/.github/workflows/check_ap2_systemd_full.yml @@ -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: diff --git a/.github/workflows/check_ap2_systemd_full_build_folder.yml b/.github/workflows/check_ap2_systemd_full_build_folder.yml index cad5bbe4..bdab8195 100644 --- a/.github/workflows/check_ap2_systemd_full_build_folder.yml +++ b/.github/workflows/check_ap2_systemd_full_build_folder.yml @@ -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: diff --git a/.github/workflows/check_ap2_systemv_full.yml b/.github/workflows/check_ap2_systemv_full.yml index 4e514430..1f8dab07 100644 --- a/.github/workflows/check_ap2_systemv_full.yml +++ b/.github/workflows/check_ap2_systemv_full.yml @@ -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: diff --git a/.github/workflows/check_classic_mac_basic.yml b/.github/workflows/check_classic_mac_basic.yml index f53de4a2..b06e046a 100644 --- a/.github/workflows/check_classic_mac_basic.yml +++ b/.github/workflows/check_classic_mac_basic.yml @@ -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: diff --git a/.github/workflows/check_classic_systemd_basic.yml b/.github/workflows/check_classic_systemd_basic.yml index 82525484..95f9d904 100644 --- a/.github/workflows/check_classic_systemd_basic.yml +++ b/.github/workflows/check_classic_systemd_basic.yml @@ -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: diff --git a/.github/workflows/check_classic_systemd_full.yml b/.github/workflows/check_classic_systemd_full.yml index 57bb7ac5..75229469 100644 --- a/.github/workflows/check_classic_systemd_full.yml +++ b/.github/workflows/check_classic_systemd_full.yml @@ -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: diff --git a/.github/workflows/docker-build-on-push.yaml b/.github/workflows/docker-build-on-push_and_pull_request.yaml 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 79ac8eac..fdbeb810 100644 --- a/.github/workflows/docker-build-on-push.yaml +++ b/.github/workflows/docker-build-on-push_and_pull_request.yaml @@ -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