Skip to content

Fix conditionals that trigger Artifact upload #38236

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

Merged
merged 6 commits into from
Feb 27, 2025
Merged
Changes from 4 commits
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
14 changes: 11 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,19 +289,27 @@ jobs:
if: startsWith( matrix.go-version, '1.23' ) != true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to the comment above, what do we want to do with this part specifically? Currently we're running tests in both go versions, is that the intended behavior? Should we be testing only with go 1.23? go 1.24?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be testing both versions, that looks a bit weird yep https://github.com/open-telemetry/opentelemetry-collector?tab=readme-ov-file#compatibility

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll just remove that conditional then... Just creates confusion

run: make gotest GROUP=${{ matrix.group }}
- name: Run Unit Tests With JUnit and Coverage
if: startsWith( matrix.go-version, '1.23' ) # only run junit/coverage on one version
id: tests-with-junit
if: startsWith( matrix.go-version, '~1.23' ) # only run junit/coverage on one version
continue-on-error: true # Allow uploading artifacts even if the test fails
run: make gotest-with-junit-and-cover GROUP=${{ matrix.group }}
- uses: actions/upload-artifact@v4
if: startsWith( matrix.go-version, '1.23' ) # only upload artifact for one version
if: startsWith( matrix.go-version, '~1.23' ) # only upload artifact for one version
with:
name: coverage-artifacts-${{ matrix.go-version }}-${{ matrix.runner }}-${{ matrix.group }}
path: ${{ matrix.group }}-coverage.txt
- uses: actions/upload-artifact@v4
if: startsWith( matrix.go-version, '1.23' ) # only upload artifact for one version
if: startsWith( matrix.go-version, '~1.23' ) # only upload artifact for one version
with:
name: test-results-${{ matrix.go-version }}-${{ matrix.runner }}-${{ matrix.group }}
path: internal/tools/testresults/
retention-days: 4
- name: Fail workflow if tests fails
if: steps.tests-with-junit.outcome == 'failure'
run: |
echo "Tests failed. Failing workflow."
exit 1

unittest:
if: ${{ github.actor != 'dependabot[bot]' && always() }}
runs-on: ubuntu-24.04
Expand Down
Loading