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

Consistency and clarity pass on our workflows #76

Merged
merged 7 commits into from
Feb 11, 2022

Conversation

brrygrdn
Copy link
Contributor

@brrygrdn brrygrdn commented Feb 10, 2022

We've had some off and on issues with the check on the dist/ folder generating different outcomes on people's machines to main.

While debugging this the fact this check is a quick and dirty git diff --quiet dist that just breaks the build without giving output makes it annoying to debug.

This branch started out as an attempt to make this friendlier, but I ended up doing a cleanup pass on our workflows addressing the following:

  • The diff check is now ran as it's own separate workflow
    • It now uses a script to actually show you the diff when it fails 🤦🏻
    • I've also moved our 'check the built action actually runs' step into this file as both of them are concerned with validating the contents of the dist/ folder
  • All workflows that run npm command now use setup-node to ensure they use the right version from our .nvmrc file
  • The test workflow previously ran prettier and eslint using their --fix style modes, meaning any problems were silently corrected in CI rather than failing the build
  • I've unrolled the npm run all command into separate steps so the Action UI does the work of breaking the output up for us ✨
  • Finally, I realised we don't actually need to build the dist/ folder for the CodeQL build, so I've slimmed it down to the bare minimum of steps

TODO:

  • Remove the old "test \ build" step as a required check run
  • Add "check dist" steps are required check runs

- Use setup-node with .nvmrc in all workflows
- Prefer to use checkout with an explicit ref in all workflows
- Minor legibility pass on step names/spacing
@brrygrdn brrygrdn changed the title Add dist diff currently generated on main Consistency and clarity pass on our workflows Feb 10, 2022
@brrygrdn brrygrdn marked this pull request as ready for review February 10, 2022 22:04
@brrygrdn brrygrdn requested a review from a team as a code owner February 10, 2022 22:04
@@ -19,24 +19,18 @@ jobs:
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't actually need the matrix: here, this can just move to line 33, but when I did that in dependabot@3cf6580, it resulted in our continuity of CodeQL Analysis being reset as it essentially saw this as a brand new analysis.

I decided to leave it as it was to avoid any confusion.

- uses: actions/checkout@v2
- uses: ./
with:
milliseconds: 1000
Copy link
Contributor Author

@brrygrdn brrygrdn Feb 10, 2022

Choose a reason for hiding this comment

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

This now just lives in check-dist as it makes sense to do all verification in the 'check the compile' workflow and focus this workflow on developer CI steps

Copy link
Contributor

@mctofu mctofu left a comment

Choose a reason for hiding this comment

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

💯

.github/workflows/test.yml Outdated Show resolved Hide resolved
@brrygrdn brrygrdn merged commit 8d0b958 into main Feb 11, 2022
@brrygrdn brrygrdn deleted the brrygrdn/mystery-dist-diff branch February 11, 2022 11:30
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