Skip to content

Commit

Permalink
feat(ci): Upload junit.xml from Jest as GH Actions build artifact and…
Browse files Browse the repository at this point in the history
… improve junit.xml naming (#12044)
  • Loading branch information
janpio committed Feb 28, 2022
1 parent 0957d75 commit b239090
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/test.yml
Expand Up @@ -588,9 +588,6 @@ jobs:
node: [16]
queryEngine: ['library', 'binary']

env:
JEST_JUNIT_SUITE_NAME: '${{ matrix.os }}/node-${{ matrix.node }}/${{ matrix.queryEngine }}/{title}'

steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -633,6 +630,7 @@ jobs:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}
JEST_JUNIT_SUITE_NAME: '${{ matrix.os }}/node-${{ matrix.node }}/${{ matrix.queryEngine }}/${{ github.job }}/sdk'

- uses: codecov/codecov-action@v2
if: ${{ contains(needs.detect_jobs_to_run.outputs.jobs, '-all-') }} || contains(needs.detect_jobs_to_run.outputs.jobs, '-sdk-') }}
Expand All @@ -649,6 +647,7 @@ jobs:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}
JEST_JUNIT_SUITE_NAME: '${{ matrix.os }}/node-${{ matrix.node }}/${{ matrix.queryEngine }}/${{ github.job }}/migrate'

- uses: codecov/codecov-action@v2
if: ${{ contains(needs.detect_jobs_to_run.outputs.jobs, '-all-') || contains(needs.detect_jobs_to_run.outputs.jobs, '-migrate-') }}
Expand All @@ -665,6 +664,7 @@ jobs:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}
JEST_JUNIT_SUITE_NAME: '${{ matrix.os }}/node-${{ matrix.node }}/${{ matrix.queryEngine }}/${{ github.job }}/cli'

- uses: codecov/codecov-action@v2
if: ${{ contains(needs.detect_jobs_to_run.outputs.jobs, '-all-') || contains(needs.detect_jobs_to_run.outputs.jobs, '-cli-') }}
Expand All @@ -681,6 +681,7 @@ jobs:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}
JEST_JUNIT_SUITE_NAME: '${{ matrix.os }}/node-${{ matrix.node }}/${{ matrix.queryEngine }}/${{ github.job }}/debug'

- uses: codecov/codecov-action@v2
if: ${{ contains(needs.detect_jobs_to_run.outputs.jobs, '-all-') }}
Expand All @@ -697,6 +698,7 @@ jobs:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}
JEST_JUNIT_SUITE_NAME: '${{ matrix.os }}/node-${{ matrix.node }}/${{ matrix.queryEngine }}/${{ github.job }}/engine-core'

- uses: codecov/codecov-action@v2
if: ${{ contains(needs.detect_jobs_to_run.outputs.jobs, '-all-') }}
Expand All @@ -713,6 +715,7 @@ jobs:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}
JEST_JUNIT_SUITE_NAME: '${{ matrix.os }}/node-${{ matrix.node }}/${{ matrix.queryEngine }}/${{ github.job }}/generator-helper'

- uses: codecov/codecov-action@v2
if: ${{ contains(needs.detect_jobs_to_run.outputs.jobs, '-all-') }}
Expand All @@ -734,6 +737,12 @@ jobs:
chmod +x ./buildpulse-test-reporter
./buildpulse-test-reporter submit packages --account-id 17219288 --repository-id 192925833
- uses: actions/upload-artifact@v2
if: always()
with:
name: ${{ matrix.os }}_node-${{ matrix.node }}_${{ matrix.queryEngine }}_${{ github.job }}_junit.xml
path: packages/*/junit.xml

#
# Run Client tests on macOS and Windows. (Rasoning see above)
#
Expand All @@ -754,9 +763,6 @@ jobs:
node: [16]
queryEngine: ['library', 'binary']

env:
JEST_JUNIT_SUITE_NAME: '${{ matrix.os }}/node-${{ matrix.node }}/${{ matrix.queryEngine }}/{title}'

steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -800,6 +806,7 @@ jobs:
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}
NODE_OPTIONS: '--max-old-space-size=8096'
JEST_JUNIT_SUITE_NAME: '${{ matrix.os }}/node-${{ matrix.node }}/${{ matrix.queryEngine }}/${{ github.job }}/client'

- uses: codecov/codecov-action@v2
if: ${{ contains(needs.detect_jobs_to_run.outputs.jobs, '-all-') || contains(needs.detect_jobs_to_run.outputs.jobs, '-client-') }}
Expand All @@ -820,3 +827,10 @@ jobs:
curl -fsSL https://get.buildpulse.io/test-reporter-darwin-amd64 > ./buildpulse-test-reporter
chmod +x ./buildpulse-test-reporter
./buildpulse-test-reporter submit packages/client --account-id 17219288 --repository-id 192925833
- uses: actions/upload-artifact@v2
if: always()
with:
name: ${{ matrix.os }}_node-${{ matrix.node }}_${{ matrix.queryEngine }}_${{ github.job }}_junit.xml
path: packages/*/junit.xml

0 comments on commit b239090

Please sign in to comment.