-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
📖 Description
Create a reusable test.yml workflow to be used across all the repositories of Octokit.js ecosystem.
🏁 Goal
- To centralize GitHub Workflows used across repositories in Octokit so we can easily maintain them in a single point
- To reduce the noise Renovatebot produces when a third-party GitHub Action inside our workflows has an update1.
🔭 Scope
- As a first step, this re-usable workflow will support
octokit/*{.js|.ts}only. - Runs
npm run lint --if-present - Runs
npm run build --if-present(context here)
🔮 Future work
- Compose
actions/checkoutandactions/setup-nodeand evaluate the execution time (more info here) - Extend this workflow to support the remaining
octokit/*of the JS Ecosystem (more info here) - To evaluate the type-only test with
tsd(context here)
🚚 Migration Plan
WIP
💬 Discussion points / 🚫 Blockers
Parametrize node_versions [Solved ✅]
node_versions [Solved ✅]
The idea would be to parametrize the node_versions for strategy.matrix but apparently, GitHub Action Inputs do not support string[] as an input type (see here, here and here).
Conclusion 🧑⚖️
We are using `fromJSON` helper (details [here](https://github.com//pull/13#discussion_r922566626))Custom steps in test.yml [Solved ✅]
test.yml [Solved ✅]
Right now, most of our test.yml used across Octokit.js repositories have the following code:
name: Test
jobs:
test_matrix:
runs-on: ubuntu-latest
strategy:
matrix:
node_version:
- 18
- 20
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: npm
- run: npm ci
- run: npm test
test:
runs-on: ubuntu-latest
needs: test_matrix
steps:
- run: exit 1
if: ${{ needs.test_matrix.result != 'success' }}
- uses: actions/checkout@v3
- run: npm ci
- run: npm run lint
if: ${{ always() }}But there are some repositories which have extra steps or different steps:
- Example workflow missing
lintscript - Example workflow with extra step:
node scripts/update - Example workflow with extra steps in
test_matrixjob - etc.
- What approach do we want to follow for custom steps?
- Extra
custom-testworkflows which extend a generictest.yml? - Add extra logic to
test.ymlto give support to all the use cases?
- Extra
Conclusion 🧑⚖️
- We want to support all the use cases by adding extra logic (more details [here](https://github.com//pull/13#issuecomment-1186010553)). - As a first step, we will focus onoctokit/*{.js|.ts} repositories
Footnotes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels