From: Alexis Romero Date: Thu, 16 Nov 2023 15:49:50 +0000 (+0100) Subject: make build-and-test-all reusable X-Git-Tag: auth-4.7.5~9^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4d2c20c8863091ed2cc069d38bdcf6813155edc1;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 ff9f0dc6dd..b42f92160f 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' @@ -23,6 +30,7 @@ jobs: with: fetch-depth: 5 submodules: recursive + ref: ${{ inputs.branch-name }} - name: get timestamp for cache id: get-stamp run: | @@ -44,10 +52,11 @@ jobs: - run: inv ci-auth-run-unit-tests - 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-auth + name: pdns-auth-${{ env.normalized-branch-name }} path: /opt/pdns-auth retention-days: 1 @@ -89,10 +98,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-auth + name: pdns-auth-${{ env.normalized-branch-name }} path: /opt/pdns-auth # - name: Setup upterm session # uses: lhotari/action-upterm@v1 @@ -199,10 +210,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-auth + name: pdns-auth-${{ env.normalized-branch-name }} path: /opt/pdns-auth # - name: Setup upterm session # uses: lhotari/action-upterm@v1 @@ -224,10 +237,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-auth + name: pdns-auth-${{ env.normalized-branch-name }} path: /opt/pdns-auth - run: build-scripts/gh-actions-setup-inv # this runs apt update+upgrade - run: inv install-clang-runtime @@ -242,6 +257,7 @@ jobs: with: fetch-depth: 5 submodules: recursive + ref: ${{ inputs.branch-name }} - run: build-scripts/gh-actions-setup-inv # this runs apt update+upgrade - run: inv install-swagger-tools - run: inv swagger-syntax-check @@ -264,6 +280,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