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

ci: github actions workflow improvements #5177

Merged
merged 19 commits into from
Aug 1, 2024
Merged

Conversation

voxpelli
Copy link
Member

@voxpelli voxpelli commented Jul 15, 2024

Overview

The major benefit is that the workflows are lot DRY:er now – main definition is only 40 lines of code since all the repetitive boilerplate is ripped out into a reusable part:

jobs:
lint:
uses: ./.github/workflows/npm-script.yml
with:
npm-script: lint
smoke:
uses: ./.github/workflows/npm-script.yml
with:
os: 'ubuntu-latest,windows-2019'
node-versions: '14,16,18,20,22'
npm-script: test:smoke
test-node:
# TODO: Restore "mocha-github-actions-reporter" style reporting without relying on third party module
uses: ./.github/workflows/npm-script.yml
needs: smoke
with:
os: 'ubuntu-latest,windows-2019'
node-versions: '14,16,18,20,22'
npm-script: test:node
coverage: true
test-browser-local:
needs: smoke
uses: ./.github/workflows/npm-script.yml
with:
browsers: ChromeHeadless
npm-script: test:browser
test-browser-saucelabs:
# Don't run forked 'pull_request' without saucelabs token
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
needs:
- smoke
- test-browser-local
uses: ./.github/workflows/npm-script.yml
secrets: inherit
with:
browsers: 'firefox@latest,chrome@latest,MicrosoftEdge@latest,safari@latest'
npm-script: test:browser

This also ensures that the caching, installation etc will behave consistently in all the places and makes it easy to evolve it in a consistent manor.

@voxpelli voxpelli changed the title ci: GitHub Actions workflow improvements ci: github actions workflow improvements Jul 15, 2024
@voxpelli voxpelli requested a review from a team July 15, 2024 23:23
@voxpelli voxpelli force-pushed the workflow-improvements branch from 19ae145 to e769953 Compare July 15, 2024 23:38
@coveralls
Copy link

coveralls commented Jul 15, 2024

Coverage Status

coverage: 94.538% (+0.2%) from 94.38%
when pulling 3b5845f on workflow-improvements
into 24560c1 on main.

@voxpelli voxpelli self-assigned this Aug 1, 2024
@voxpelli voxpelli marked this pull request as ready for review August 1, 2024 12:16
@voxpelli voxpelli mentioned this pull request Aug 1, 2024
7 tasks
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

🚀 This is fantastic, thanks for the cleanup!

Nothing blocking from me. Just a couple of questions.

.github/workflows/mocha.yml Show resolved Hide resolved
.github/workflows/npm-script.yml Show resolved Hide resolved
.github/workflows/npm-script.yml Show resolved Hide resolved
@voxpelli voxpelli merged commit a8f8c8b into main Aug 1, 2024
34 checks passed
@voxpelli voxpelli deleted the workflow-improvements branch August 1, 2024 14:25
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