Skip to content

Commit

Permalink
update test archive publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Mar 9, 2024
1 parent 1818a67 commit df8cdce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Publish test results"
description: "Upload test artifacts to a unique archive name"
name: "Publish test logs"
description: "Upload test logs to a unique archive name"

inputs:
archive-type:
Expand All @@ -11,9 +11,6 @@ inputs:
os:
description: "OS for the archive name stub (e.g. ubuntu-latest)"
required: true
source-file:
description: "File/directory to be uploaded"
required: true

outputs:
archive-name:
Expand All @@ -23,23 +20,23 @@ outputs:
runs:
using: composite
steps:
- name: "Create unique test archive name"
- name: "Create unique archive name"
id: archive
shell: bash
run: |
timestamp=$(date +'%Y-%m-%dT%H-%M-%S')
archive_name="${{ inputs.archive-type }}_python-${{ inputs.python-version }}_${{ inputs.os }}_$timestamp"
echo "archive-name=$archive_name" >> $GITHUB_OUTPUT
- name: "Upload test results"
uses: actions/upload-artifact@v3
- name: "Upload test logs"
uses: actions/upload-artifact@v4
with:
name: ${{ steps.archive.outputs.archive-name }}
path: ./${{ inputs.source-file }}
path: ./logs

- name: "[INFO] Uploaded test artifacts"
- name: "[INFO] Uploaded test logs"
shell: bash
run: |
title="Uploaded test artifacts"
message="Uploaded ${{ inputs.source-file }} to ${{ steps.archive.outputs.archive-name }}"
title="Uploaded test logs"
message="Uploaded `./logs` to ${{ steps.archive.outputs.archive-name }}"
echo "::notice title=${{ env.NOTIFICATION_PREFIX }}: $title::$message"
7 changes: 3 additions & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@ jobs:
run: hatch run unit-tests:all
shell: bash

- name: "Publish results"
uses: ./.github/actions/publish-test-results
- name: "Publish test logs"
uses: ./.github/actions/publish-test-logs
if: ${{ contains(github.event_name, 'workflow_') }}
with:
archive-type: "unit_results"
archive-type: "unit-test"
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
source-file: "results.csv"

0 comments on commit df8cdce

Please sign in to comment.