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

fix artifact naming #591

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Changes from 1 commit
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
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 || inputs.env }}${{ inputs.container && format(' (on {0})', 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/
Loading