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

Move env, more logging #488

Merged
merged 1 commit into from
Jul 18, 2023
Merged
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
26 changes: 16 additions & 10 deletions .github/workflows/unit_test_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ jobs:
if: always()
runs-on: ubuntu-latest
name: Upload Unit Test Reports
env:
DATADOG_API_KEY: ${{ secrets.DD_API_KEY }}
DATADOG_SITE: us5.datadoghq.com
steps:
- name: Collect Unit Test Reports
id: collect-report
uses: actions/github-script@v6
with:
script: |
console.log(context);
console.log('context', context);
console.log('context.payload.workflow_run.pull_requests', context.payload.workflow_run.pull_requests);
console.log('context.payload.workflow_run.head_commit', context.payload.workflow_run.head_commit);

let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -59,7 +59,6 @@ jobs:
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/unit-test-results.zip`, Buffer.from(download.data));
console.log(`${process.env.GITHUB_WORKSPACE}/unit-test-results.zip`);
return true;
- run: unzip unit-test-results.zip -d unit-test-results
if: ${{ steps.collect-report.outputs.result == 'true' }}
Expand All @@ -76,17 +75,24 @@ jobs:
- name: Upload the JUnit files
if: ${{ steps.collect-report.outputs.result == 'true' }}
shell: bash
env:
DATADOG_API_KEY: ${{ secrets.DD_API_KEY }}
DATADOG_SITE: us5.datadoghq.com
DD_ENV: ci
DD_SERVICE: ${{ github.event.repository.name }}
# TODO
# DD_METRICS:

DD_GIT_COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
DD_GIT_REPOSITORY_URL: ${{ github.event.repository.git_url }}
run: |
# Loop over platform folders in archive

for dir in unit-test-results/*/; do
echo "Uploading $dir test report"

service="${{ github.event.repository.name }}"
tags=`cat ${dir}TAGS`

datadog-ci junit upload \
--service $service \
--env ci \
--tags $tags \
$dir
$dir/**
done
Loading