From 763c7146539933876d1f6ac34a2da0135897b365 Mon Sep 17 00:00:00 2001 From: David Chavez Date: Sun, 2 Jun 2024 16:34:25 +0200 Subject: [PATCH] CI: Split workflow execution paths (#337) --- .github/workflows/validate.yml | 19 ++++--------------- .github/workflows/validate_external.yml | 19 +++++++++++++++++++ .github/workflows/validate_internal.yml | 12 ++++++++++++ 3 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/validate_external.yml create mode 100644 .github/workflows/validate_internal.yml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 80c1b6d..32c2869 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,24 +1,14 @@ name: validate on: - push: - branches: - - dev - pull_request: - types: [opened, synchronize] + workflow_call: + secrets: + ZRE_REPO_WITH_PAT: + required: true concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: - authorize: - environment: - ${{ github.event_name == 'pull_request_target' && - github.event.pull_request.head.repo.full_name != github.repository && - 'external' || 'internal' }} - runs-on: ubuntu-latest - steps: - - run: echo ✓ build-linux: - needs: authorize runs-on: ${{ matrix.arch == 'x64' && matrix.os || format('blaze/{0}', matrix.os) }} strategy: matrix: @@ -107,7 +97,6 @@ jobs: name: Zelda64Recompiled-AppImage-${{ runner.arch }}-${{ matrix.type }} path: Zelda64Recompiled-*.AppImage build-windows: - needs: authorize runs-on: windows-latest strategy: matrix: diff --git a/.github/workflows/validate_external.yml b/.github/workflows/validate_external.yml new file mode 100644 index 0000000..4a6d894 --- /dev/null +++ b/.github/workflows/validate_external.yml @@ -0,0 +1,19 @@ +name: validate-external +on: + pull_request_target: + types: [opened, synchronize] +jobs: + authorize: + if: github.repository != github.event.pull_request.head.repo.full_name + environment: + ${{ github.event_name == 'pull_request_target' && + github.event.pull_request.head.repo.full_name != github.repository && + 'external' || 'internal' }} + runs-on: ubuntu-latest + steps: + - run: echo ✓ + build: + needs: authorize + uses: ./.github/workflows/validate.yml + secrets: + ZRE_REPO_WITH_PAT: ${{ secrets.ZRE_REPO_WITH_PAT }} diff --git a/.github/workflows/validate_internal.yml b/.github/workflows/validate_internal.yml new file mode 100644 index 0000000..f6a9eea --- /dev/null +++ b/.github/workflows/validate_internal.yml @@ -0,0 +1,12 @@ +name: validate-internal +on: + push: + branches: + - dev + pull_request: + types: [opened, synchronize] +jobs: + build: + if: github.repository == github.event.pull_request.head.repo.full_name + uses: ./.github/workflows/validate.yml + secrets: inherit