diff --git a/.github/workflows/postgresql-11-pmm.yaml b/.github/workflows/postgresql-11-pmm.yaml index d33e5c1..1791955 100644 --- a/.github/workflows/postgresql-11-pmm.yaml +++ b/.github/workflows/postgresql-11-pmm.yaml @@ -8,7 +8,7 @@ jobs: timeout-minutes: 30 steps: - name: Clone QA Integration repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: 'Percona-Lab/qa-integration' ref: 'main' @@ -16,9 +16,17 @@ jobs: # print branch and Repo name - name: Get branch and Repo Name run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor + + - name: "Set TARGET_BRANCH variable for a PR run" + if: github.event_name == 'pull_request' + run: echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV + + - name: "Set TARGET_BRANCH variable for a PUSH run" + if: github.event_name == 'push' + run: echo "TARGET_BRANCH=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=11 --pgstat-monitor-branch=REL_1_1_1 + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=11 --pgstat-monitor-branch=${{ env.TARGET_BRANCH }} - name: Get PMM-Agent Logs from the Container if: success() || failure() # run this step even if previous step failed diff --git a/.github/workflows/postgresql-12-pmm.yaml b/.github/workflows/postgresql-12-pmm.yaml index 60cb6e4..96bf832 100644 --- a/.github/workflows/postgresql-12-pmm.yaml +++ b/.github/workflows/postgresql-12-pmm.yaml @@ -8,7 +8,7 @@ jobs: timeout-minutes: 30 steps: - name: Clone QA Integration repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: 'Percona-Lab/qa-integration' ref: 'main' @@ -16,9 +16,17 @@ jobs: # print branch and Repo name - name: Get branch and Repo Name run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor + + - name: "Set TARGET_BRANCH variable for a PR run" + if: github.event_name == 'pull_request' + run: echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV + + - name: "Set TARGET_BRANCH variable for a PUSH run" + if: github.event_name == 'push' + run: echo "TARGET_BRANCH=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=12 --pgstat-monitor-branch=REL_1_1_1 + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=12 --pgstat-monitor-branch=${{ env.TARGET_BRANCH }} - name: Get PMM-Agent Logs from the Container if: success() || failure() # run this step even if previous step failed diff --git a/.github/workflows/postgresql-13-pmm.yaml b/.github/workflows/postgresql-13-pmm.yaml index 93c5cd0..5d6f108 100644 --- a/.github/workflows/postgresql-13-pmm.yaml +++ b/.github/workflows/postgresql-13-pmm.yaml @@ -8,7 +8,7 @@ jobs: timeout-minutes: 30 steps: - name: Clone QA Integration repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: 'Percona-Lab/qa-integration' ref: 'main' @@ -17,8 +17,16 @@ jobs: - name: Get branch and Repo Name run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor + - name: "Set TARGET_BRANCH variable for a PR run" + if: github.event_name == 'pull_request' + run: echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV + + - name: "Set TARGET_BRANCH variable for a PUSH run" + if: github.event_name == 'push' + run: echo "TARGET_BRANCH=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=13 --pgstat-monitor-branch=REL_1_1_1 + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=13 --pgstat-monitor-branch=${{ env.TARGET_BRANCH }} - name: Get PMM-Agent Logs from the Container if: success() || failure() # run this step even if previous step failed diff --git a/.github/workflows/postgresql-14-pmm.yaml b/.github/workflows/postgresql-14-pmm.yaml index 20d0d11..1f83111 100644 --- a/.github/workflows/postgresql-14-pmm.yaml +++ b/.github/workflows/postgresql-14-pmm.yaml @@ -8,7 +8,7 @@ jobs: timeout-minutes: 30 steps: - name: Clone QA Integration repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: 'Percona-Lab/qa-integration' ref: 'main' @@ -17,8 +17,16 @@ jobs: - name: Get branch and Repo Name run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor + - name: "Set TARGET_BRANCH variable for a PR run" + if: github.event_name == 'pull_request' + run: echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV + + - name: "Set TARGET_BRANCH variable for a PUSH run" + if: github.event_name == 'push' + run: echo "TARGET_BRANCH=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=14 --pgstat-monitor-branch=REL_1_1_1 + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=14 --pgstat-monitor-branch=${{ env.TARGET_BRANCH }} - name: Get PMM-Agent Logs from the Container if: success() || failure() # run this step even if previous step failed diff --git a/.github/workflows/postgresql-15-pmm.yaml b/.github/workflows/postgresql-15-pmm.yaml index 073fa1b..40e4930 100644 --- a/.github/workflows/postgresql-15-pmm.yaml +++ b/.github/workflows/postgresql-15-pmm.yaml @@ -8,7 +8,7 @@ jobs: timeout-minutes: 30 steps: - name: Clone QA Integration repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: 'Percona-Lab/qa-integration' ref: 'main' @@ -17,8 +17,16 @@ jobs: - name: Get branch and Repo Name run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor + - name: "Set TARGET_BRANCH variable for a PR run" + if: github.event_name == 'pull_request' + run: echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV + + - name: "Set TARGET_BRANCH variable for a PUSH run" + if: github.event_name == 'push' + run: echo "TARGET_BRANCH=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=15 --pgstat-monitor-branch=REL_1_1_1 + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=15 --pgstat-monitor-branch=${{ env.TARGET_BRANCH }} - name: Get PMM-Agent Logs from the Container if: success() || failure() # run this step even if previous step failed