You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.4 KiB
47 lines
1.4 KiB
name: "Setup"
|
|
description: Setup the environment for the project
|
|
inputs:
|
|
python-version:
|
|
description: "Python version to use"
|
|
required: false
|
|
default: "3.10"
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Free up disk space
|
|
run: |
|
|
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
|
|
sudo docker image prune --all --force
|
|
shell: bash
|
|
- name: Set up Python ${{ inputs.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ inputs.python-version }}
|
|
- name: Install and configure Poetry
|
|
uses: snok/install-poetry@v1
|
|
with:
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
installer-parallel: true
|
|
- name: Load cached venv
|
|
id: cached-poetry-dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: .venv
|
|
key: venv-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
|
- name: Install dependencies
|
|
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
|
run: poetry install --no-interaction --no-root
|
|
shell: bash
|
|
- name: Activate venv
|
|
run: |
|
|
source .venv/bin/activate
|
|
echo PATH=$PATH >> $GITHUB_ENV
|
|
shell: bash
|
|
# - name: "Install apt dependencies"
|
|
# run: |
|
|
# sudo apt-get update
|
|
# sudo apt-get install -y python3-opencv
|
|
# shell: bash
|