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 3ac92f2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 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 @@ -40,9 +41,16 @@ jobs:
- name: Setup line endings
run: git config --global core.autocrlf false

- name: Change default TEST_DETECT_RACE when on non main branch and tagged ones
if: github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')
run: |
echo "TEST_DETECT_RACE=false" >> $GITHUB_ENV
- 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 +140,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 3ac92f2

Please sign in to comment.