name: Build RCAMP and run unit tests
on: [push, pull_request]
jobs:
  run_rcamp_tests:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Setup Env
      run: |
        export UWSGI_UID=$(id -u); echo "UWSGI_UID=${UWSGI_UID}" >> $GITHUB_ENV
        export UWSGI_GID=$(id -g); echo "UWSGI_GID=${UWSGI_GID}" >> $GITHUB_ENV

    - name: Test env
      run: |
        echo "${{ env.UWSGI_UID }}"
        echo "${{ env.UWSGI_GID }}"

    - name: Build
      run: |
        docker-compose build

    - name: Start Service
      run: |
        docker-compose up -d
        docker-compose exec rcamp-uwsgi bash -c 'sleep 30s && python manage.py migrate'

    - name: Run Tests
      run: docker-compose exec rcamp-uwsgi python3 manage.py test

    - name: Stop Containers
      run: docker-compose down --remove-orphans

name: Build RCAMP and run unit tests
on: [push, pull_request]
jobs:
  run_rcamp_tests:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Setup Env
      run: |
        export UWSGI_UID=$(id -u); echo "UWSGI_UID=${UWSGI_UID}" >> $GITHUB_ENV
        export UWSGI_GID=$(id -g); echo "UWSGI_GID=${UWSGI_GID}" >> $GITHUB_ENV

    - name: Test env
      run: |
        echo "${{ env.UWSGI_UID }}"
        echo "${{ env.UWSGI_GID }}"

    - name: Build
      run: |
        docker-compose build

    - name: Start Service
      run: |
        docker-compose up -d
        docker-compose exec -T rcamp-uwsgi bash -c 'sleep 30s && python manage.py migrate'

    - name: Run Tests
      run: docker-compose exec -T rcamp-uwsgi python3 manage.py test

    - name: Stop Containers
      run: docker-compose down --remove-orphans

Fix input is not a TTY error
Fix input is not a TTY error
