I'm learning the basics of Github Actions for CICD. I use Poetry for Dependencies Managements. But I keep throwing poetry: command not found. If I run source $HOME/.poetry/env in every step (which opens new shell with my limited knowledge), It works. I tried to modify the .bashrc with cat $HOME/.poetry/env >> ~/.bashrc, but It doesn't work.
Here is my Yaml file, thanks ^^
name: Django CI
on:
push:
branches:
- master
- develop
pull_request:
branches:
# - develop
- master
jobs:
Unit tests:
runs-on: ubuntu-latest
strategy: # Strategy
max-parallel: 4
matrix:
python-version: [3.8]
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
steps:
- name: Checkout Github repo
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
source $HOME/.poetry/env
cat $HOME/.poetry/env >> ~/.bashrc
poetry install
echo "OK"
- name: Run unit tests
run: |
# If I run "source $HOME/.poetry/env", It works
poetry run python manage.py test