Python application #20
Workflow file for this run
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 workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Python application | |
on: | |
workflow_dispatch: | |
# Inputs the workflow accepts. | |
inputs: | |
name: | |
# Friendly description to be shown in the UI instead of 'name' | |
description: 'Person to greet' | |
# Default value if no value is explicitly provided | |
default: 'World' | |
# Input has to be provided for the workflow to run | |
required: false | |
# The data type of the input | |
type: string | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
PYTHONPATH: ${{ github.workspace }}/backend/src | |
services: | |
db: | |
image: postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: app | |
POSTGRES_SERVER: db | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Create env file | |
run: | | |
touch .env | |
echo "$(<fakenv.txt )" > .env | |
cat .env | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip | |
- name: Install Dependencies | |
run: pip install -r ./backend/src/requirements.txt | |
# - name: Set PYTHONPATH to env | |
# run: echo "/home/runner/work/codejavu-backend/codejavu-backend/backend/src" >> "$GITHUB_PATH" | |
# run: echo "PYTHONPATH='${PYTHONPATH}:/Users/onu/dev/PycharmProjects/codejavu-backend/backend/src' | |
- name: Set POSTGRES_USER to env | |
run: echo "POSTGRES_USER=postgres" >> "$GITHUB_ENV" | |
- name: Set POSTGRES_PASSWORD to env | |
run: echo "POSTGRES_PASSWORD=password" >> "$GITHUB_ENV" | |
- name: Set POSTGRES_DB to env | |
run: echo "POSTGRES_DB=app" >> "$GITHUB_ENV" | |
- name: Set POSTGRES_SERVER to env | |
run: echo "POSTGRES_SERVER=db" >> "$GITHUB_ENV" | |
- name: Current directory | |
run: pwd | |
- name: See files and folders | |
run: ls | |
- name: Test test script | |
run: | | |
cd backend && | |
bash src/tests-start.sh "$@" | |