Skip to content

Commit

Permalink
chore: pass node version as param instead
Browse files Browse the repository at this point in the history
  • Loading branch information
TheUnderScorer committed Oct 27, 2023
1 parent 83a6705 commit 4b8dc7e
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 7 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/analyze-commits.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: 'Analyze Commits'
on:
workflow_call:
inputs:
nodeVersion:
description: 'Node version to use'
required: false
type: string
default: '20.x'

jobs:
commitlint:
Expand All @@ -13,7 +19,7 @@ jobs:
- name: 'Install latest node version'
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
node-version: ${{ inputs.nodeVersion }}
- uses: wagoid/commitlint-github-action@v5
id: commitlint
- if: ${{ failure() && steps.commitlint.outcome == 'failure' }}
Expand Down Expand Up @@ -50,7 +56,7 @@ jobs:
- name: 'Install latest node version'
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
node-version: ${{ inputs.nodeVersion }}
- name: Collect semantic-release-info
id: semantic_release_info
uses: fingerprintjs/action-semantic-release-info@v1
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/build-typescript-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
description: 'Additional flags for yarn install'
required: false
type: string
nodeVersion:
description: 'Node version to use'
required: false
type: string
default: '20.x'
artifactName:
description: 'Name of the artifact to upload'
required: false
Expand Down Expand Up @@ -38,7 +43,7 @@ jobs:
- name: 'Install latest node version'
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
node-version: ${{ inputs.nodeVersion }}

- name: 'Cache'
uses: actions/cache@v3
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/coverage-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: 'Run tests & check coverage workflow'
on:
workflow_call:
inputs:
nodeVersion:
description: 'Node version to use'
required: false
type: string
default: '20.x'
testScript:
type: string
required: false
Expand All @@ -23,7 +28,7 @@ jobs:
- name: 'Install latest node version'
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
node-version: ${{ inputs.nodeVersion }}

- name: Cache
uses: actions/cache@v3
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/docs-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: 'Generate docs and coverage report'
on:
workflow_call:
inputs:
node-version:
description: 'Node version to use'
required: false
type: string
default: '20.x'
run-after-install:
type: string
required: false
Expand Down Expand Up @@ -31,7 +36,7 @@ jobs:
- name: 'Install latest node version'
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
node-version: ${{ inputs.node-version }}

- name: Cache
uses: actions/cache@v3
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/release-typescript-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: 'Release TypeScript project'
on:
workflow_call:
inputs:
nodeVersion:
description: 'Node version to use'
required: false
type: string
default: '20.x'
runAfterInstall:
type: string
required: false
Expand Down Expand Up @@ -39,7 +44,7 @@ jobs:
- name: 'Install latest node version'
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
node-version: ${{ inputs.nodeVersion }}

- name: 'Download dist folder artifact'
if: ${{ inputs.distFolderNeedForRelease }}
Expand Down
1 change: 0 additions & 1 deletion .node-version

This file was deleted.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
|-------------------|----------|--------|------------|------------------------------------------------|
| `runAfterInstall` | No | String | `""` | Commands to run after installing dependencies. |
| `testScript` | No | String | `npx jest` | The test script to run. |
| `nodeVersion` | No | String | `20.x` | Node version to use |

#### Example of usage:

Expand Down Expand Up @@ -57,6 +58,7 @@ jobs:
| `prepare-gh-pages-commands` | No | String | <pre>mv docs ./gh-pages<br>mv coverage/lcov-report ./gh-pages/coverage</pre> | Commands to prepare the content of the `gh-pages` folder. The `gh-pages` folder will be created automatically. Only specify the commands for moving files into it. |
| `skip-docs-step` | No | Boolean | `false` | Skip the documentation generation step. |
| `run-after-install` | No | String | `""` | Commands to run after installing dependencies. |
| `node-version` | No | String | `20.x` | Node version to use |

#### Example of usage with default behavior:

Expand Down Expand Up @@ -148,6 +150,7 @@ jobs:
| `artifactName` | No | String | `""` | Name of the artifact to upload. If not provided, the artifact upload step will be skipped. |
| `artifactPath` | No | String | `"./dist"` | Path of the files to upload as artifact. |
| `runAfterInstall` | No | String | `""` | Commands to run after installing dependencies. |
| `nodeVersion` | No | String | `20.x` | Node version to use |

#### Examples of usage:

Expand Down Expand Up @@ -229,6 +232,7 @@ The workflow expects the following secrets to be provided:
|----------------------------|----------|---------|---------|-----------------------------------------------------------|
| `runAfterInstall` | No | String | `""` | Commands to run after installing dependencies. |
| `distFolderNeedForRelease` | No | Boolean | `false` | Flag that we need `dist` folder to start release process. |
| `nodeVersion` | No | String | `20.x` | Node version to use |

#### Usage

Expand Down

0 comments on commit 4b8dc7e

Please sign in to comment.