Skip to content

Commit

Permalink
github-actions: support test-report with download/upload v4 (#1499)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Nov 4, 2024
1 parent 76169a8 commit 20a083a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
run: .ci/scripts/install-build-system.sh
- name: Create gem
run: rake build
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: package
path: ./pkg/**/*
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/run-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,24 @@ jobs:
run: ./spec/scripts/spec.sh ${{ matrix.version }} ${{ matrix.framework }}
env:
JUNIT_PREFIX: ${{ matrix.version }}-${{ matrix.framework }}

- if: success() || failure()
uses: actions/upload-artifact@v3
id: normalize-junit
uses: actions/github-script@v7
with:
result-encoding: string
script: |
function normalizeName(name) {
return name.replace(/["/:<>|*?\\]/g, '-')
}
const framework = normalizeName('${{ matrix.framework }}')
const version = normalizeName('${{ matrix.version }}')
return `test-results-${version}-${framework}`
- if: success() || failure()
name: Upload JUnit Test Results
uses: actions/upload-artifact@v4
with:
name: test-results
name: ${{ steps.normalize-junit.outputs.result }}
path: "**/spec/junit-reports/**/*ruby-agent-junit.xml"
- if: success() || failure()
uses: actions/upload-artifact@v3
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test-reporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ on:

permissions:
contents: read
actions: read
checks: write

jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: elastic/apm-pipeline-library/.github/actions/test-report@current
- uses: elastic/oblt-actions/test-report@v1
with:
artifact: test-results
name: test-report
artifact: /test-results(.*)/
name: 'Test Report $1'
path: "**/*ruby-agent-junit.xml"
reporter: java-junit

0 comments on commit 20a083a

Please sign in to comment.