From: Alexis Romero Date: Thu, 16 Nov 2023 15:56:20 +0000 (+0100) Subject: make build-and-test-all reusable X-Git-Tag: rec-5.0.0-rc2~2^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=432561613fd1965090848bae8bb58fa8fac7063c;p=thirdparty%2Fpdns.git make build-and-test-all reusable --- diff --git a/.github/workflows/build-and-test-all.yml b/.github/workflows/build-and-test-all.yml index f9b484847e..9779c7e565 100644 --- a/.github/workflows/build-and-test-all.yml +++ b/.github/workflows/build-and-test-all.yml @@ -4,6 +4,13 @@ name: 'Build and test everything' on: push: pull_request: + workflow_call: + inputs: + branch-name: + description: 'Checkout to a specific branch' + required: true + default: '' + type: string schedule: - cron: '0 22 * * 3' @@ -45,6 +52,7 @@ jobs: with: fetch-depth: 5 submodules: recursive + ref: ${{ inputs.branch-name }} - name: get timestamp for cache id: get-stamp run: | @@ -82,10 +90,11 @@ jobs: allow-empty: true - run: inv ci-make-install - run: ccache -s + - run: echo "normalized-branch-name=${{ inputs.branch-name || github.ref_name }}" | tr "/" "-" >> "$GITHUB_ENV" - name: Store the binaries uses: actions/upload-artifact@v3 # this takes 30 seconds, maybe we want to tar with: - name: pdns-recursor-${{ matrix.sanitizers }} + name: pdns-recursor-${{ matrix.sanitizers }}-${{ env.normalized-branch-name }} path: /opt/pdns-recursor retention-days: 1 @@ -110,10 +119,12 @@ jobs: with: fetch-depth: 5 submodules: recursive + ref: ${{ inputs.branch-name }} + - run: echo "normalized-branch-name=${{ inputs.branch-name || github.ref_name }}" | tr "/" "-" >> "$GITHUB_ENV" - name: Fetch the binaries uses: actions/download-artifact@v3 with: - name: pdns-recursor-${{ matrix.sanitizers }} + name: pdns-recursor-${{ matrix.sanitizers }}-${{ env.normalized-branch-name }} path: /opt/pdns-recursor - run: inv apt-fresh - run: inv add-auth-repo ${{ matrix.dist_name }} ${{ matrix.dist_release_name }} ${{ matrix.pdns_repo_version }} @@ -153,10 +164,12 @@ jobs: with: fetch-depth: 5 submodules: recursive + ref: ${{ inputs.branch-name }} + - run: echo "normalized-branch-name=${{ inputs.branch-name || github.ref_name }}" | tr "/" "-" >> "$GITHUB_ENV" - name: Fetch the binaries uses: actions/download-artifact@v3 with: - name: pdns-recursor-${{ matrix.sanitizers }} + name: pdns-recursor-${{ matrix.sanitizers }}-${{ env.normalized-branch-name }} path: /opt/pdns-recursor - run: inv apt-fresh - run: inv add-auth-repo ${{ matrix.dist_name }} ${{ matrix.dist_release_name }} ${{ matrix.pdns_repo_version }} @@ -196,10 +209,12 @@ jobs: with: fetch-depth: 5 submodules: recursive + ref: ${{ inputs.branch-name }} + - run: echo "normalized-branch-name=${{ inputs.branch-name || github.ref_name }}" | tr "/" "-" >> "$GITHUB_ENV" - name: Fetch the binaries uses: actions/download-artifact@v3 with: - name: pdns-recursor-${{ matrix.sanitizers }} + name: pdns-recursor-${{ matrix.sanitizers }}-${{ env.normalized-branch-name }} path: /opt/pdns-recursor - run: inv install-clang-runtime - run: inv install-rec-bulk-deps @@ -237,6 +252,7 @@ jobs: with: fetch-depth: 5 submodules: recursive + ref: ${{ inputs.branch-name }} - name: Get list of jobs in the workflow run: "yq e '.jobs | keys' .github/workflows/build-and-test-all.yml | awk '{print $2}' | grep -v collect | sort | tee /tmp/workflow-jobs-list.yml" - name: Get list of prerequisite jobs