-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reusable action for tests created and kept node version and package p…
…ath as input
- Loading branch information
Showing
5 changed files
with
75 additions
and
65 deletions.
There are no files selected for viewing
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,12 +1,23 @@ | ||
name: Setup Node.js and Install Dependencies | ||
description: Sets up a specific Node.js version, caches Node modules, and installs Node dependencies. | ||
|
||
inputs: | ||
node-version: | ||
description: 'Node.js version' | ||
required: true | ||
default: '16.13.2' | ||
|
||
package-path: | ||
description: 'Path to package.json file' | ||
required: false | ||
default: '.' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 16.13.2 | ||
node-version: ${{ inputs.node-version }} | ||
|
||
- id: npm-cache-dir | ||
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT | ||
|
@@ -15,7 +26,7 @@ runs: | |
- uses: actions/cache@v4 | ||
with: | ||
path: "${{ steps.npm-cache-dir.outputs.dir }}" | ||
key: "${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}" | ||
key: "${{ runner.os }}-node-${{ hashFiles(inputs.package-path + '/package-lock.json') }}" | ||
restore-keys: "${{ runner.os }}-node-" | ||
|
||
- run: npm ci | ||
|
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,51 @@ | ||
name: Setup Tests | ||
description: Sets up the testing environment by checking out the code, setting up Python and Node.js, caching Python packages, installing Kedro and other Python dependencies, and building the React application. | ||
|
||
inputs: | ||
os: | ||
description: 'Operating system' | ||
required: true | ||
default: 'ubuntu-latest' | ||
python-version: | ||
description: 'Python version' | ||
required: true | ||
default: '3.9' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{inputs.python-version}} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{inputs.python-version}} | ||
|
||
- name: Cache python packages for Linux | ||
if: inputs.os == 'ubuntu-latest' | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{inputs.os}}-python-${{inputs.python-version}} | ||
|
||
- name: Cache python packages for Windows | ||
if: inputs.os == 'windows-latest' | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~\AppData\Local\pip\Cache | ||
key: ${{inputs.os}}-python-${{inputs.python-version}} | ||
|
||
- name: Install Kedro and other Python Dependencies | ||
uses: "./.github/actions/install_python_dependencies" | ||
|
||
- name: Setup Node.js and Install Dependencies | ||
uses: "./.github/actions/install_node_dependencies" | ||
with: | ||
node-version: '16.13.2' | ||
|
||
- name: Build React application | ||
run: |- | ||
node -v | ||
make build | ||
shell: bash |
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
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
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