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

Refactor GH action workflows #874

Merged
merged 26 commits into from
Jun 28, 2024
Merged

Refactor GH action workflows #874

merged 26 commits into from
Jun 28, 2024

Conversation

rygine
Copy link
Collaborator

@rygine rygine commented Jun 28, 2024

Summary

  • Removed unused build.yml and release.yml workflows
  • Renamed github-pages.yml to deploy-docs.yml
  • Updated workspace linting workflow
    • Renamed lint.yml to lint-workspace.yml
    • Added path filtering
    • Removed FFI bindings linting
  • Added new workflow (lint-ffi-bindings.yml) for linting FFI bindings with path filtering
  • Updated workspace test workflow
    • Added path filtering
    • Removed FFI bindings testing
  • Added new workflow (test-ffi-bindings.yml) for testing FFI bindings with path filtering
  • Added new workflow (noop.yml) for non-code changes
  • Updated validation server deployment workflow
    • Renamed validation-server-publish.yml to deploy-validation-service.yml
    • Added ability to manually deploy via workflow dispatch
  • Updated all runners to use the fastest machines available when applicable
  • Removed use of outdated or deprecated actions
  • Upgraded all actions to their latest version
  • Ensured that the rust toolchains are updated and targets added before restoring cache (see top comment on the example for more details)

For this PR to pass all checks, I'll need to change the required check lint to Lint.

Notes on path filtering

There are only 2 required checks for pull requests: Lint and Test. This refactoring ensures that these steps are run on every PR. Not every file change will result in linting or testing all code. For example, when only the Node bindings have changes, linting and testing will not run on the FFI bindings (and vice-versa). When only non-code changes occur, linting and testing steps are a no-op.

Unfortunately, we must do this song and dance because if a required check doesn't run as a result of path filtering (paths and paths-ignore), GitHub doesn't recognize that the check can be skipped.

Ignored code paths

The following code directories are currently ignored:

  • bindings_wasm: there's nothing of value here yet
  • xmtp_grpc_api_gateway: this is related to bindings_wasm
  • xmtp_user_preferences: AFAIK, this is not currently used in the main branch

Notes on rust tooling

GitHub and Warp action runners come with rust pre-installed. There's no need to use actions to run rustup or cargo.

Naming conventions

With these changes, I'm hoping to establish new naming conventions for our GitHub workflow files. We currently deploy, lint, release, and test our code. So I've prefixed the filenames with those actions followed by what part of the code base it's acting on. There's only 1 exception to this: noop. Hopefully this exception will go away once GitHub is able to allow skipping of required checks when they don't run as a result of path filtering.

Fast follows

There's a very small chance that a deploy or release action doesn't work after these changes. If so, fixing them should be straight-forward.

@rygine rygine requested a review from a team as a code owner June 28, 2024 03:31
@rygine rygine force-pushed the rygine/refactor-gh-actions branch from 6f8a38b to 1168689 Compare June 28, 2024 04:03
@rygine rygine merged commit e61585a into main Jun 28, 2024
8 checks passed
@rygine rygine deleted the rygine/refactor-gh-actions branch June 28, 2024 17:41
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.

2 participants