Skip to content

Commit

Permalink
fix artifact naming (#591)
Browse files Browse the repository at this point in the history
* fix artifact naming

* improve name format

(cherry picked from commit 5df57b2)
  • Loading branch information
GuyAv46 authored and github-actions[bot] committed Jan 6, 2025
1 parent 83ba99f commit 8de18a3
Showing 1 changed file with 12 additions and 34 deletions.
46 changes: 12 additions & 34 deletions .github/workflows/task-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:

jobs:
test:
name: Test ${{ inputs.container || inputs.env }}
name: Test ${{ inputs.container && format('{0} (on {1})', inputs.container, inputs.env) || inputs.env }}
runs-on: ${{ inputs.env }}
container: ${{ inputs.container || null }}
defaults:
Expand All @@ -31,51 +31,29 @@ jobs:
if: ${{ inputs.pre-checkout-script }}
shell: sh -l -eo pipefail {0}
run: ${{ inputs.pre-checkout-script }}
- name: Check for node20 support
id: node20 # TODO: Remove this when node20 is supported on all platforms, or when we drop support for theses platforms
run: |
for os in amazonlinux:2 ubuntu:bionic; do
if [ "${{ inputs.container }}" = "$os" ]; then
# https://github.com/actions/checkout/issues/1809
# https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV
echo "supported=false" >> $GITHUB_OUTPUT
exit 0
fi
done
echo "supported=true" >> $GITHUB_OUTPUT
- name: checkout
if: steps.node20.outputs.supported == 'true'
uses: actions/checkout@v4
with:
ref: ${{ github.event.number && format('refs/pull/{0}/merge', github.event.number) || github.head_ref }}
- name: checkout (fallback)
if: steps.node20.outputs.supported == 'false'
uses: actions/checkout@v3
with:
ref: ${{ github.event.number && format('refs/pull/{0}/merge', github.event.number) || github.head_ref }}
- name: install dependencies
run: .install/install_script.sh ${{ !inputs.container && 'sudo' || '' }}
- name: Set Artifact Name
# Artifact names have to be unique, so we base them on the environment.
# We also remove invalid characters from the name.
id: artifact-name
run: | # Invalid characters include: Double quote ", Colon :, Less than <, Greater than >, Vertical bar |, Asterisk *, Question mark ?
NAME="${{ inputs.container && format('{0} (on {1})', inputs.container, inputs.env) || inputs.env }} ${{ runner.arch }}"
NAME="$(echo $NAME | sed -e 's/[":\/\\<>\|*?]/_/g')" # Replace invalid characters with underscores
echo "name=$NAME" >> $GITHUB_OUTPUT
- name: unit tests
run: make unit_test
- name: valgrind
if: ${{ inputs.run-valgrind }}
run: make valgrind
- name: Set Artifact Names
# Artifact names have to be unique, so we base them on the environment.
# We also remove invalid characters from the name.
id: artifact-names
run: | # Invalid characters include: Double quote ", Colon :, Less than <, Greater than >, Vertical bar |, Asterisk *, Question mark ?
echo "name=$(echo "${{ inputs.container || inputs.env }} ${{ runner.arch }}" | sed -e 's/[":\/\\<>\|*?]/_/g')" >> $GITHUB_OUTPUT
- name: Archive valgrind tests reports
if: ${{ inputs.run-valgrind && failure() && steps.node20.outputs.supported == 'true' }}
if: ${{ inputs.run-valgrind && failure() }}
uses: actions/upload-artifact@v4
with:
name: valgrind tests reports ${{ steps.artifact-names.outputs.name }}
path: bin/Linux-x86_64-debug/unit_tests/Testing/Temporary/
- name: Archive valgrind tests reports (fallback)
if: ${{ inputs.run-valgrind && failure() && steps.node20.outputs.supported == 'false' }}
uses: actions/upload-artifact@v3
with:
name: valgrind tests reports ${{ steps.artifact-names.outputs.name }}
name: valgrind tests reports on ${{ steps.artifact-name.outputs.name }}
path: bin/Linux-x86_64-debug/unit_tests/Testing/Temporary/

0 comments on commit 8de18a3

Please sign in to comment.