Skip to content

Commit

Permalink
fix: don't upload test results from build-only workflow. Support arti…
Browse files Browse the repository at this point in the history
…fact suffixes (#607)

The build-without-secrets flow was broken because it was trying to upload an empty results artifact to the same name as the interop test. This no longer works in upload-artifacts v4.

This fixes it by not uploading that empty file.
  • Loading branch information
MarcoPolo authored Feb 5, 2025
1 parent de0fb45 commit 0adfc24
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
15 changes: 12 additions & 3 deletions .github/actions/run-transport-interop-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ inputs:
description: "Filter which tests to run out of the created matrix"
required: false
default: ""
upload-results:
description: "Upload the test results as an artifact"
required: false
default: "true"
test-results-suffix:
description: "Suffix to add to the test results artifact name"
required: false
default: ""
test-ignore:
description: "Exclude tests from the created matrix that include this string in their name"
required: false
Expand Down Expand Up @@ -141,10 +149,11 @@ runs:
exit 0
fi
shell: bash

- uses: actions/upload-artifact@v4
- name: Upload test results
if: ${{ inputs.upload-results == 'true' }}
uses: actions/upload-artifact@v4
with:
name: test-plans-output
name: ${{ inputs.test-results-suffix && format('test-plans-output-{0}', inputs.test-results-suffix) || 'test-plans-output' }}
path: |
${{ steps.find-workdir.outputs.WORK_DIR }}/results.csv
${{ steps.find-workdir.outputs.WORK_DIR }}/dashboard.md
11 changes: 7 additions & 4 deletions .github/workflows/transport-interop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ on:
workflow_dispatch:
pull_request:
paths:
- 'transport-interop/**'
- "transport-interop/**"
- ".github/actions/run-transport-interop-test/action.yml"
- ".github/workflows/transport-interop.yml"
push:
branches:
- "master"
paths:
- 'transport-interop/**'
- "transport-interop/**"

name: libp2p transport interop test

jobs:
run-transport-interop:
runs-on: ['self-hosted', 'linux', 'x64', '4xlarge'] # https://github.com/pl-strflt/tf-aws-gh-runner/blob/main/runners.tf
runs-on: ["self-hosted", "linux", "x64", "4xlarge"] # https://github.com/pl-strflt/tf-aws-gh-runner/blob/main/runners.tf
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/run-transport-interop-test
Expand All @@ -23,11 +25,12 @@ jobs:
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
worker-count: 16
build-without-secrets:
runs-on: ['self-hosted', 'linux', 'x64', '4xlarge'] # https://github.com/pl-strflt/tf-aws-gh-runner/blob/main/runners.tf
runs-on: ["self-hosted", "linux", "x64", "4xlarge"] # https://github.com/pl-strflt/tf-aws-gh-runner/blob/main/runners.tf
steps:
- uses: actions/checkout@v3
# Purposely not using secrets to replicate how forks will behave.
- uses: ./.github/actions/run-transport-interop-test
with:
# It's okay to not run the tests, we only care to check if the tests build without cache.
upload-results: false
test-filter: '"no test matches this, skip all"'

0 comments on commit 0adfc24

Please sign in to comment.