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: improve workflow #455

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

chore: improve workflow #455

wants to merge 10 commits into from

Conversation

Xaroz
Copy link
Contributor

@Xaroz Xaroz commented Dec 26, 2024

Description

Improve the workflow a bit with separating validation and optimization:

  • Separate SVG validation and optimization
  • Refactor files by making the access to get files path easier
  • Add workflow for validation of files

PD: still need to change optimization workflow to run on (probably) every commit to main

Backward compatibility

Yes

Testing

Manual

@Xaroz Xaroz requested review from jmrossy and xeno097 December 26, 2024 16:17
@Xaroz Xaroz self-assigned this Dec 26, 2024
@Xaroz Xaroz requested a review from paulbalaji December 26, 2024 16:17
@Xaroz Xaroz marked this pull request as ready for review December 26, 2024 16:19
Copy link

changeset-bot bot commented Dec 26, 2024

🦋 Changeset detected

Latest commit: 248f926

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hyperlane-xyz/registry Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Xaroz Xaroz changed the title Chore/improve workflow chore: improve workflow Dec 26, 2024
.changeset/fresh-turkeys-grow.md Show resolved Hide resolved
push:
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why narrow this job down to these types?

Copy link
Contributor Author

@Xaroz Xaroz Dec 26, 2024

Choose a reason for hiding this comment

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

The idea was to have the CI auto-run for every PR to the repo and this would prevent the CI to run on PRs that didn't meet these criteria. I know we discarded the idea of having it auto-run on every third-party PR, but I think this is still good, wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

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

What's wrong with having it run on every PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The initial plan for this was that if we would change the permissions so that we wouldn't need to approve a workflow for it to run, so by doing these we would make sure only these types of PR would auto-run the workflow

Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to approve the workflows for security reasons, I don't think narrowing down the PR type will help. I recommend cutting this but it's up to you.

scripts/common.js Outdated Show resolved Hide resolved
Comment on lines 35 to 38
- name: setup-node
uses: actions/setup-node@v3
with:
node-version: 20
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious, what happens if you remove this? I think the ubuntu image already has node. That's why the CI job doesn't include this step and why the yarn install step before it works.

Copy link
Contributor Author

@Xaroz Xaroz Dec 26, 2024

Choose a reason for hiding this comment

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

So doing a bit more digging, yes it does work but apparently the reason people still include this is that they don't want to rely on the default that comes installed with ubuntu-latest and have a bit more of a controlled environment. Other than that it also manages the Node.js installation in a way that is more optimized for Github Actions.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand but we should be consistent. Either use it in all the workflows or none. And if you're going to add it, use actions/setup-node@v4 which is the latest.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed here, I will look into adding it to all the other workflows on another PR, we can discuss this further

@Xaroz Xaroz requested a review from jmrossy December 26, 2024 20:37
@@ -0,0 +1,24 @@
import { getFilePaths } from './utils.js';
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI it doesn't have to be in this PR but this file would be a good place to solve this: #209

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, we can discuss this later, but I was maybe thinking having a different file for checks related to chain and checks related to deployments

push:
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to approve the workflows for security reasons, I don't think narrowing down the PR type will help. I recommend cutting this but it's up to you.

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