Skip to content

Conversation

gcurtis
Copy link
Collaborator

@gcurtis gcurtis commented Sep 22, 2022

Summary

Update the debug workflow to echo a message with some basic info on how to use tmate. Also rename the job to debug, put the timeout at the job level, and set a Homebrew GitHub token to help with rate limiting (as described below).

The changes in the second commit fix some of the rate limit issues in testa and clean up the job:

  • Set HOMEBREW_GITHUB_API_TOKEN to tell Homebrew to use our CI token to authenticate with the GitHub API. This drastically increases the rate limit.
  • Combine the two test jobs into a single matrix job. When installing additional shells, just look at the RUNNER_OS env var to decide whether to use apt or brew.
  • Install Nix with a single build user to speed up the install time.
  • Source Nix and set the relevant env vars in the install step so we don't forget to do it in other steps that need Nix.
  • Run go tests with the race detector and code coverage.

How was it tested?

N/A

Add a debug workflow that makes it easier to figure out what's going
wrong in CI.

This workflow can only be started manually. It prints some diagnostic
info (like current rate limits) and then starts a tmate session. The
tmate session lets whoever started the run login into the runner with an
an interactive shell. A timeout ensures that the session is eventually
terminated.
- Set HOMEBREW_GITHUB_API_TOKEN to tell Homebrew to use our CI token to
  authenticate with the GitHub API. This drastically increases the rate
  limit.
- Combine the two test jobs into a single matrix job. When installing
  additional shells, just look at the RUNNER_OS env var to decide
  whether to use apt or brew.
- Install Nix with a single build user to speed up the install time.
- Source Nix and set the relevant env vars in the install step so we
  don't forget to do it in other steps that need Nix.
- Run go tests with the race detector and code coverage.
run: |
sudo apt-get update
sudo apt-get install dash zsh
if [ "$RUNNER_OS" == "Linux" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

You could use if on the steps themselves, might be clearer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I went with the env var because I thought it looked weird always seeing a skipped step. If this grows to include more OS-specific commands, then I agree it would be worth splitting up.

@gcurtis gcurtis merged commit 333c193 into main Sep 26, 2022
@gcurtis gcurtis deleted the gcurtis/cifixes branch September 26, 2022 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants