Skip to content

CI Results

CI Results #602

name: CI Results
on:
workflow_run:
workflows: ["CI"]
types:
- completed
jobs:
publish:
name: "Process CI Results"
runs-on: ubuntu-latest
permissions:
actions: read
checks: write
pull-requests: write
if: always()
steps:
- name: Download Artifacts
uses: actions/github-script@v3.1.0
with:
script: |
var fs = require('fs');
var path = require('path');
var artifacts_path = path.join('${{github.workspace}}', 'artifacts')
fs.mkdirSync(artifacts_path, { recursive: true })
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }},
});
for (const artifact of artifacts.data.artifacts) {
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact.id,
archive_format: 'zip',
});
var artifact_path = path.join(artifacts_path, `${artifact.name}.zip`)
fs.writeFileSync(artifact_path, Buffer.from(download.data));
console.log(`Downloaded ${artifact_path}`);
}
- name: Extract Artifacts
run: |
for file in artifacts/*.zip
do
if [ -f "$file" ]
then
dir="${file/%.zip/}"
mkdir -p "$dir"
unzip -d "$dir" "$file"
fi
done
- name: Show Artifacts
run: find artifacts -ls
- name: Publish Results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
check_name: View Test Results
commit: ${{ github.event.workflow_run.head_sha }}
github_token: ${{ secrets.GITHUB_TOKEN }}
files: "artifacts/test_results/junit.xml"
# Disabled pending the outcome of https://github.com/yuzutech/annotations-action/issues/23
# - name: Publish Docstring Annotations
# uses: yuzutech/annotations-action@v0.3.0
# with:
# repo-token: "${{ secrets.GITHUB_TOKEN }}"
# title: "Docstrings linter"
# input: "annotations.json/annotations.json"