Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github-actions: support test-report with download/upload v4 #1499

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading