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

chore(ci): run tests against PRs #354

Merged
merged 1 commit into from
Aug 2, 2024
Merged

chore(ci): run tests against PRs #354

merged 1 commit into from
Aug 2, 2024

Conversation

displague
Copy link
Member

@displague displague commented Jul 16, 2024

Explicitly run tests against PRs.
Keep the Go test environment in sync with go.mod.

Changes were pulled in comparison to https://github.com/equinix/metal-cli/blob/main/.github/workflows/test.yml

@displague
Copy link
Member Author

I've misjudged the effect of the current config. PRs are being run against source and fork branches today without the proposed change.

#353
https://github.com/equinix-labs/otel-cli/actions/runs/9022693766/job/24912460814

@displague
Copy link
Member Author

displague commented Jul 16, 2024

It looks like branch protection rules are triggering CI today. This PR will make that configuration more explicit which should help forks and orgs hosting this project without explicit branch protection policies.

# otel-cli's main test needs the binary built ahead of time
# also this validates it can acutally build before we get there
- name: Build
# build with -s -w to reduce binary size and verify that build in test
run: go build -v -ldflags="-s -w -X main.version=test -X main.commit=${{ github.sha }}"
- name: Test
run: go test -v ./...
run: go test -v -cover -parallel 4 ./...
Copy link
Collaborator

Choose a reason for hiding this comment

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

It probably won't hurt anything but the test suite won't really parallelize.

@tobert tobert merged commit 3a5648d into main Aug 2, 2024
1 check passed
@tobert tobert deleted the test-prs branch August 2, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants