Skip to content

Commit

Permalink
Backport of Update the if conditions for test-go jobs in CI into rele…
Browse files Browse the repository at this point in the history
…ase/1.13.x (hashicorp#19872)

* Update the if conditions for test-go jobs in CI

* Fix errors in comments

* Update the if condition for the UI tests

---------

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
  • Loading branch information
1 parent 36535f8 commit e3f471c
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,12 @@ jobs:
needs:
- setup
- setup-go-cache
# Don't run this job for branches starting with 'ui/', 'docs/', or 'backport/docs/'
if: ${{ ! (startsWith( github.ref_name, 'ui/' ) || startsWith( github.ref_name, 'docs/' ) || startsWith( github.ref_name, 'backport/docs/') ) }}
# Don't run this job for PR branches starting with 'ui/', 'backport/ui/', 'docs/', or 'backport/docs/'
if: |
!startsWith(github.head_ref, 'ui/') &&
!startsWith(github.head_ref, 'backport/ui/') &&
!startsWith(github.head_ref, 'docs/') &&
!startsWith(github.head_ref, 'backport/docs/')
uses: ./.github/workflows/test-go.yml
with:
total-runners: 16
Expand All @@ -130,8 +134,12 @@ jobs:
needs:
- setup
- setup-go-cache
# Don't run this job for branches starting with 'ui/', 'docs/', or 'backport/docs/'
if: ${{ ! (startsWith( github.ref_name, 'ui/' ) || startsWith( github.ref_name, 'docs/' ) || startsWith( github.ref_name, 'backport/docs/') ) }}
# Don't run this job for PR branches starting with 'ui/', 'backport/ui/', 'docs/', or 'backport/docs/'
if: |
!startsWith(github.head_ref, 'ui/') &&
!startsWith(github.head_ref, 'backport/ui/') &&
!startsWith(github.head_ref, 'docs/') &&
!startsWith(github.head_ref, 'backport/docs/')
uses: ./.github/workflows/test-go.yml
with:
total-runners: 16
Expand All @@ -147,10 +155,13 @@ jobs:
secrets: inherit
test-go-fips:
name: Run Go tests with FIPS configuration
# Only run this job for the enterprise repo if the branch doesn't start with 'ui/', 'docs/', or 'backport/docs/'.
# Only run this job for the enterprise repo if the PR branch doesn't start with 'ui/', 'backport/ui/', 'docs/', or 'backport/docs/'
if: |
needs.setup.outputs.enterprise == 1 &&
! (startsWith( github.ref_name, 'ui/' ) || startsWith( github.ref_name, 'docs/' ) || startsWith( github.ref_name, 'backport/docs/'))
!startsWith(github.head_ref, 'ui/') &&
!startsWith(github.head_ref, 'backport/ui/') &&
!startsWith(github.head_ref, 'docs/') &&
!startsWith(github.head_ref, 'backport/docs/')
needs:
- setup
- setup-go-cache
Expand All @@ -168,8 +179,16 @@ jobs:
secrets: inherit
test-ui:
name: Test UI
# The test-ui Job is only run for pushes to main, ui/*, backport/ui/*, release/*, and merge*
if: github.ref_name == 'main' || startsWith(github.ref_name, 'ui/') || startsWith(github.ref_name, 'backport/ui/') || startsWith(github.ref_name, 'release/') || startsWith(github.ref_name, 'merge')
# The test-ui job is only run on:
# - pushes to main and branches starting with "release/"
# - PRs where the branch starts with "ui/", "backport/ui/", "merge", or when base branch starts with "release/"
if: |
github.ref_name == 'main' ||
startsWith(github.ref_name, 'release/') ||
startsWith(github.base_ref, 'release/') ||
startsWith(github.head_ref, 'ui/') ||
startsWith(github.head_ref, 'backport/ui/') ||
startsWith(github.head_ref, 'merge')
needs:
- setup
permissions:
Expand Down

0 comments on commit e3f471c

Please sign in to comment.