Skip to content

Commit

Permalink
fix: Add -race command line argument only for development branches
Browse files Browse the repository at this point in the history
on main and tagged branches it is always present
  • Loading branch information
Matovidlo committed Dec 12, 2024
1 parent f351423 commit e0bc2ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/actions/go-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,6 @@ runs:
# To find problematic dir/file: Run the workflow twice, download tests logs, sort lines and make a diff.
# https://pkg.go.dev/cmd/go#hdr-Build_and_test_caching
- name: Enable debugging of the Go test cache
if: false # disabled, enable for debugging
if: "true" # disabled, enable for debugging
shell: bash
run: echo "GODEBUG=gocachehash=1" >> $GITHUB_ENV
8 changes: 6 additions & 2 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
TEST_PARALLELISM: 12
TEST_PARALLELISM_PKG: 6
TEST_COVERAGE: ${{ inputs.without-cache == true }}
TEST_DETECT_RACE: ${{ inputs.without-cache == true }}

# Required for aws-actions/configure-aws-credentials using OIDC, assume role
permissions:
Expand All @@ -41,8 +42,10 @@ jobs:
run: git config --global core.autocrlf false

- name: Change default TEST_COVERAGE when on main branch
if: github.ref == 'refs/heads/main'
run: echo "TEST_COVERAGE=true" >> $GITHUB_ENV
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
run: |
echo "TEST_COVERAGE=true" >> $GITHUB_ENV
echo "TEST_DETECT_RACE=true" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -132,6 +135,7 @@ jobs:
TEST_PARALLELISM="$TEST_PARALLELISM" \
TEST_PARALLELISM_PKG="$TEST_PARALLELISM_PKG" \
TEST_COVERAGE="$TEST_COVERAGE" \
TEST_DETECT_RACE="$TEST_DETECT_RACE" \
TEST_CREATE_OUT_DIR="false" \
TEST_KBC_PROJECTS_LOCK_HOST="$TEST_KBC_PROJECTS_LOCK_HOST" \
TEST_KBC_PROJECTS_LOCK_PASSWORD="$TEST_KBC_PROJECTS_LOCK_PASSWORD" \
Expand Down

0 comments on commit e0bc2ac

Please sign in to comment.