From be97548d9e2ff1d41d3a62934d5365738f193bee Mon Sep 17 00:00:00 2001 From: Jeff Flater Date: Fri, 15 Aug 2025 12:31:19 -0500 Subject: [PATCH 1/2] test workflow --- .github/workflows/behave.api.test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/behave.api.test.yml b/.github/workflows/behave.api.test.yml index e1130c8..dad0dfe 100644 --- a/.github/workflows/behave.api.test.yml +++ b/.github/workflows/behave.api.test.yml @@ -1,7 +1,7 @@ name: Behave API Test on: - push: + pull_request: branches: [develop] # Runs dev-tests pull_request: branches: [main] # Triggers on PRs *into* main (used for staging-tests) From 166d3e06875576f41b8ea506a679c8bf118a3780 Mon Sep 17 00:00:00 2001 From: Jeff Flater Date: Fri, 15 Aug 2025 12:34:31 -0500 Subject: [PATCH 2/2] Testing Bug Fixes --- .github/workflows/behave.api.test.yml | 37 +++++++++++++++++++++------ 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/.github/workflows/behave.api.test.yml b/.github/workflows/behave.api.test.yml index dad0dfe..eae29c7 100644 --- a/.github/workflows/behave.api.test.yml +++ b/.github/workflows/behave.api.test.yml @@ -1,17 +1,25 @@ name: Behave API Test on: + # PRs into develop or main (for dev/staging test runs) pull_request: - branches: [develop] # Runs dev-tests - pull_request: - branches: [main] # Triggers on PRs *into* main (used for staging-tests) - workflow_dispatch: + branches: [develop, main] + types: [opened, synchronize, reopened, ready_for_review] + # Fire after PR is closed (for prod test run when merged) pull_request_target: - types: [closed] # Used for prod-tests (PR merged to main) + types: [closed] + # Manual run + workflow_dispatch: jobs: + # ------------------------- + # DEV: PRs into develop + # ------------------------- dev-tests: - if: github.ref == 'refs/heads/develop' + if: > + github.event_name == 'pull_request' && + github.event.pull_request.base.ref == 'develop' && + !github.event.pull_request.draft runs-on: ubuntu-latest environment: DEV @@ -38,8 +46,15 @@ jobs: name: behave-junit-report path: reports/ + # ------------------------- + # STAGING: PRs into main from staging branch + # ------------------------- staging-tests: - if: github.event.pull_request.head.ref == 'staging' && github.event.pull_request.base.ref == 'main' && !github.event.pull_request.merged + if: > + github.event_name == 'pull_request' && + github.event.pull_request.base.ref == 'main' && + github.event.pull_request.head.ref == 'staging' && + !github.event.pull_request.draft runs-on: ubuntu-latest environment: STAGING @@ -66,8 +81,14 @@ jobs: name: behave-junit-report path: reports/ + # ------------------------- + # PROD: when PR into main is merged + # ------------------------- prod-tests: - if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' + if: > + github.event_name == 'pull_request_target' && + github.event.pull_request.merged == true && + github.event.pull_request.base.ref == 'main' runs-on: ubuntu-latest environment: PROD