-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor GitHub Actions to use single node version
Removed individual action.yml files for Node 14, 16 and 18 and replaced them with a single .node-version file. Consolidated and refactored the GitHub Actions workflow in main.yml to incorporate these changes. Workflow is now set to perform lint and test jobs for Node versions defined in the .node-version file matrix.
- Loading branch information
Showing
5 changed files
with
45 additions
and
79 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,60 @@ | ||
name: Checks | ||
on: [ push ] | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- release | ||
pull_request: | ||
|
||
jobs: | ||
Lint: | ||
runs-on: ubuntu-latest | ||
lint: | ||
runs-on: [ self-hosted, small ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/node18 | ||
- name: node version | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .node-version | ||
cache: 'npm' | ||
cache-dependency-path: package-lock.json | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Display Node.js version | ||
run: node --version | ||
|
||
- name: Lint | ||
run: npm run lint | ||
|
||
Node_14: | ||
runs-on: ubuntu-latest | ||
env: | ||
NODE_ENV: test_lib | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/node14 | ||
- uses: browser-actions/setup-chrome@latest | ||
- run: chrome --version | ||
- name: node version | ||
run: node --version | ||
- name: Test | ||
run: npm run test | ||
Node_16: | ||
runs-on: ubuntu-latest | ||
env: | ||
NODE_ENV: test_lib | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/node16 | ||
- uses: browser-actions/setup-chrome@latest | ||
- run: chrome --version | ||
- name: node version | ||
run: node --version | ||
- name: test | ||
run: npm run test | ||
Node_18: | ||
runs-on: ubuntu-latest | ||
tests: | ||
runs-on: [ self-hosted, small ] | ||
env: | ||
NODE_ENV: test_lib | ||
strategy: | ||
matrix: | ||
node-version: [ 16.x, 18.x, 20.x, 21.x ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/node18 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
cache-dependency-path: package-lock.json | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- uses: browser-actions/setup-chrome@latest | ||
- run: chrome --version | ||
- name: node version | ||
|
||
- name: Display Chrome version | ||
run: chrome --version | ||
|
||
- name: Display Node.js version | ||
run: node --version | ||
- name: test | ||
|
||
- name: Run tests | ||
run: npm run test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
18 |