2022-05-28 00:38:12 +00:00
|
|
|
name: 'Setup Enviroment'
|
|
|
|
description: 'Setup the enviroment for general InvenTree tests'
|
2023-01-24 22:29:50 +00:00
|
|
|
author: 'InvenTree'
|
2022-05-28 00:38:12 +00:00
|
|
|
inputs:
|
|
|
|
python:
|
|
|
|
required: false
|
|
|
|
description: 'Install python.'
|
|
|
|
default: 'true'
|
|
|
|
npm:
|
|
|
|
required: false
|
|
|
|
description: 'Install npm.'
|
|
|
|
default: 'false'
|
|
|
|
|
|
|
|
install:
|
|
|
|
required: false
|
|
|
|
description: 'Install the InvenTree requirements?'
|
|
|
|
default: 'false'
|
2022-06-28 12:12:00 +00:00
|
|
|
dev-install:
|
|
|
|
required: false
|
|
|
|
description: 'Install the InvenTree development requirements?'
|
|
|
|
default: 'false'
|
2022-05-28 00:38:12 +00:00
|
|
|
update:
|
|
|
|
required: false
|
|
|
|
description: 'Should a full update cycle be run?'
|
|
|
|
default: 'false'
|
|
|
|
|
|
|
|
apt-dependency:
|
|
|
|
required: false
|
|
|
|
description: 'Extra APT package for install.'
|
|
|
|
pip-dependency:
|
|
|
|
required: false
|
|
|
|
description: 'Extra python package for install.'
|
|
|
|
|
|
|
|
runs:
|
|
|
|
using: 'composite'
|
|
|
|
steps:
|
|
|
|
- name: Checkout Code
|
2022-10-17 02:46:12 +00:00
|
|
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # pin@v3.1.0
|
2022-05-28 00:38:12 +00:00
|
|
|
|
|
|
|
# Python installs
|
|
|
|
- name: Set up Python ${{ env.python_version }}
|
|
|
|
if: ${{ inputs.python == 'true' }}
|
2022-10-17 02:46:12 +00:00
|
|
|
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # pin@v4.3.0
|
2022-05-28 00:38:12 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ env.python_version }}
|
|
|
|
cache: pip
|
|
|
|
- name: Install Base Python Dependencies
|
|
|
|
if: ${{ inputs.python == 'true' }}
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
python3 -m pip install -U pip
|
|
|
|
pip3 install invoke wheel
|
|
|
|
- name: Install Specific Python Dependencies
|
|
|
|
if: ${{ inputs.pip-dependency }}
|
|
|
|
shell: bash
|
|
|
|
run: pip3 install ${{ inputs.pip-dependency }}
|
|
|
|
|
|
|
|
# NPM installs
|
|
|
|
- name: Install node.js ${{ env.node_version }}
|
|
|
|
if: ${{ inputs.npm == 'true' }}
|
2022-10-17 02:46:12 +00:00
|
|
|
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # pin to v3.5.0
|
2022-05-28 00:38:12 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ env.node_version }}
|
|
|
|
cache: 'npm'
|
|
|
|
- name: Intall npm packages
|
|
|
|
if: ${{ inputs.npm == 'true' }}
|
|
|
|
shell: bash
|
|
|
|
run: npm install
|
|
|
|
|
|
|
|
# OS installs
|
|
|
|
- name: Install OS Dependencies
|
|
|
|
if: ${{ inputs.apt-dependency }}
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install ${{ inputs.apt-dependency }}
|
|
|
|
|
|
|
|
# Invoke commands
|
2022-06-28 12:12:00 +00:00
|
|
|
- name: Install dev requirements
|
|
|
|
if: ${{ inputs.dev-install == 'true' ||inputs.install == 'true' }}
|
|
|
|
shell: bash
|
|
|
|
run: pip install -r requirements-dev.txt
|
2022-05-28 00:38:12 +00:00
|
|
|
- name: Run invoke install
|
|
|
|
if: ${{ inputs.install == 'true' }}
|
|
|
|
shell: bash
|
|
|
|
run: invoke install
|
|
|
|
- name: Run invoke update
|
|
|
|
if: ${{ inputs.update == 'true' }}
|
|
|
|
shell: bash
|
|
|
|
run: invoke update
|