Skip to content

Commit 5df57b2

Browse files
authored
fix artifact naming (RedisAI#591)
* fix artifact naming * improve name format
1 parent 8055e5c commit 5df57b2

File tree

1 file changed

+12
-34
lines changed

1 file changed

+12
-34
lines changed

.github/workflows/task-unit-test.yml

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020

2121
jobs:
2222
test:
23-
name: Test ${{ inputs.container || inputs.env }}
23+
name: Test ${{ inputs.container && format('{0} (on {1})', inputs.container, inputs.env) || inputs.env }}
2424
runs-on: ${{ inputs.env }}
2525
container: ${{ inputs.container || null }}
2626
defaults:
@@ -31,51 +31,29 @@ jobs:
3131
if: ${{ inputs.pre-checkout-script }}
3232
shell: sh -l -eo pipefail {0}
3333
run: ${{ inputs.pre-checkout-script }}
34-
- name: Check for node20 support
35-
id: node20 # TODO: Remove this when node20 is supported on all platforms, or when we drop support for theses platforms
36-
run: |
37-
for os in amazonlinux:2 ubuntu:bionic; do
38-
if [ "${{ inputs.container }}" = "$os" ]; then
39-
# https://github.com/actions/checkout/issues/1809
40-
# https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
41-
echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV
42-
echo "supported=false" >> $GITHUB_OUTPUT
43-
exit 0
44-
fi
45-
done
46-
echo "supported=true" >> $GITHUB_OUTPUT
4734
- name: checkout
48-
if: steps.node20.outputs.supported == 'true'
4935
uses: actions/checkout@v4
5036
with:
5137
ref: ${{ github.event.number && format('refs/pull/{0}/merge', github.event.number) || github.head_ref }}
52-
- name: checkout (fallback)
53-
if: steps.node20.outputs.supported == 'false'
54-
uses: actions/checkout@v3
55-
with:
56-
ref: ${{ github.event.number && format('refs/pull/{0}/merge', github.event.number) || github.head_ref }}
5738
- name: install dependencies
5839
run: .install/install_script.sh ${{ !inputs.container && 'sudo' || '' }}
40+
- name: Set Artifact Name
41+
# Artifact names have to be unique, so we base them on the environment.
42+
# We also remove invalid characters from the name.
43+
id: artifact-name
44+
run: | # Invalid characters include: Double quote ", Colon :, Less than <, Greater than >, Vertical bar |, Asterisk *, Question mark ?
45+
NAME="${{ inputs.container && format('{0} (on {1})', inputs.container, inputs.env) || inputs.env }} ${{ runner.arch }}"
46+
NAME="$(echo $NAME | sed -e 's/[":\/\\<>\|*?]/_/g')" # Replace invalid characters with underscores
47+
echo "name=$NAME" >> $GITHUB_OUTPUT
48+
5949
- name: unit tests
6050
run: make unit_test
6151
- name: valgrind
6252
if: ${{ inputs.run-valgrind }}
6353
run: make valgrind
64-
- name: Set Artifact Names
65-
# Artifact names have to be unique, so we base them on the environment.
66-
# We also remove invalid characters from the name.
67-
id: artifact-names
68-
run: | # Invalid characters include: Double quote ", Colon :, Less than <, Greater than >, Vertical bar |, Asterisk *, Question mark ?
69-
echo "name=$(echo "${{ inputs.container || inputs.env }} ${{ runner.arch }}" | sed -e 's/[":\/\\<>\|*?]/_/g')" >> $GITHUB_OUTPUT
7054
- name: Archive valgrind tests reports
71-
if: ${{ inputs.run-valgrind && failure() && steps.node20.outputs.supported == 'true' }}
55+
if: ${{ inputs.run-valgrind && failure() }}
7256
uses: actions/upload-artifact@v4
7357
with:
74-
name: valgrind tests reports ${{ steps.artifact-names.outputs.name }}
75-
path: bin/Linux-x86_64-debug/unit_tests/Testing/Temporary/
76-
- name: Archive valgrind tests reports (fallback)
77-
if: ${{ inputs.run-valgrind && failure() && steps.node20.outputs.supported == 'false' }}
78-
uses: actions/upload-artifact@v3
79-
with:
80-
name: valgrind tests reports ${{ steps.artifact-names.outputs.name }}
58+
name: valgrind tests reports on ${{ steps.artifact-name.outputs.name }}
8159
path: bin/Linux-x86_64-debug/unit_tests/Testing/Temporary/

0 commit comments

Comments
 (0)