chore(ci): unpins node version for release and prelease workflows #613
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "*/**.md" | |
- "*/**.txt" | |
- "*/**.yml" | |
pull_request: | |
paths-ignore: | |
- "*/**.md" | |
- "*/**.txt" | |
- "*/**.yml" | |
workflow_dispatch: | |
env: | |
CI: true | |
NODE_LATEST: 23.x | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
check: | |
name: check | |
strategy: | |
fail-fast: true | |
matrix: | |
node-version: | |
- 18.x | |
- 23.x | |
platform: | |
- ubuntu-latest | |
runs-on: ${{matrix.platform}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{matrix.node-version}}@${{matrix.platform}}-build-${{hashFiles('package.json')}} | |
restore-keys: | | |
${{matrix.node-version}}@${{matrix.platform}}-build- | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{matrix.node-version}} | |
- run: npm install | |
- run: npm run build | |
- run: npm run depcruise -- --no-cache --progress performance-log | |
- run: npm test | |
- name: emit coverage results to step summary | |
if: always() && matrix.node-version == env.NODE_LATEST | |
run: | | |
echo '## Code coverage' >> $GITHUB_STEP_SUMMARY | |
npx tsx tools/istanbul-json-summary-to-markdown.ts < coverage/coverage-summary.json >> $GITHUB_STEP_SUMMARY | |
- name: on pushes to the default branch emit full depcruise results to step summary | |
if: always() && matrix.node-version == env.NODE_LATEST && github.event_name == 'push' && github.ref_name == github.event.repository.default_branch | |
run: | | |
yarn --silent depcruise --output-type markdown >> $GITHUB_STEP_SUMMARY | |
echo '## Visual overview' >> $GITHUB_STEP_SUMMARY | |
echo '```mermaid' >> $GITHUB_STEP_SUMMARY | |
yarn --silent depcruise --exclude ".test.ts$" --include-only "^(src)" --output-type mermaid >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
- name: on pull requests emit depcruise results + diff graph to step summary | |
if: always() && matrix.node-version == env.NODE_LATEST && github.event_name == 'pull_request' && github.ref_name != github.event.repository.default_branch | |
run: | | |
yarn --silent depcruise --output-type markdown >> $GITHUB_STEP_SUMMARY | |
echo '## Visual diff' >> $GITHUB_STEP_SUMMARY | |
echo '```mermaid' >> $GITHUB_STEP_SUMMARY | |
SHA=${{github.event.pull_request.base.sha}} yarn --silent depcruise:graph:diff:mermaid >> $GITHUB_STEP_SUMMARY | |
echo '' >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY |