📖 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
🚚 Migration Plan
WIP
💬 Discussion points / 🚫 Blockers
Parametrize 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 ✅]
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:
- What approach do we want to follow for custom steps?
- Extra
custom-test workflows which extend a generic test.yml?
- Add extra logic to
test.yml to give support to all the use cases?
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 on octokit/*{.js|.ts} repositories
📖 Description
Create a reusable test.yml workflow to be used across all the repositories of Octokit.js ecosystem.
🏁 Goal
🔭 Scope
octokit/*{.js|.ts}only.npm run lint --if-presentnpm run build --if-present(context here)🔮 Future work
actions/checkoutandactions/setup-nodeand evaluate the execution time (more info here)octokit/*of the JS Ecosystem (more info here)tsd(context here)🚚 Migration Plan
WIP
💬 Discussion points / 🚫 Blockers
Parametrize
node_versions[Solved ✅]The idea would be to parametrize the
node_versionsforstrategy.matrixbut apparently, GitHub Action Inputs do not supportstring[]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 ✅]Right now, most of our
test.ymlused across Octokit.js repositories have the following code:But there are some repositories which have extra steps or different steps:
lintscriptnode scripts/updatetest_matrixjobcustom-testworkflows which extend a generictest.yml?test.ymlto give support to all the use cases?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}repositoriesFootnotes
https://github.com/orgs/octokit/teams/js-community/discussions/11?from_comment=12 ↩