Skip to content

add the enviroment variable for api base url #60

add the enviroment variable for api base url

add the enviroment variable for api base url #60

Workflow file for this run

name: Tests for Main Merge
on:
# pull_request:
# branches:
# - main
push:
branches:
- feature/custom-testing-base-url
jobs:
tests-on-main:
runs-on: ubuntu-latest
env:
# Set environment variables globally for all steps within the job
GOOGLE_PROJECT_ID: ${{ vars.GOOGLE_PROJECT_ID }}
GOOGLE_EARTH_ENGINE_SERVICE_ACCOUNT_CREDENTIALS: ${{ secrets.GOOGLE_EARTH_ENGINE_SERVICE_ACCOUNT_CREDENTIALS }}
GOOGLE_EARTH_ENGINE_SERVICE_ACCOUNT_EMAIL: ${{ secrets.GOOGLE_EARTH_ENGINE_SERVICE_ACCOUNT_EMAIL }}
ENVIRONMENT: ${{ vars.ENVIRONMENT }}
steps:
- uses: actions/checkout@v3
# Build and the run the backend docker image
- name: Build and Run the Docker image (backend)
working-directory: ./backend
run: |
docker buildx build --platform linux/amd64 -t thf-climate-backend .
docker run -d -p 8000:8000 --name thf-climate-backend thf-climate-backend
- name: Wait for the application to start
working-directory: ./backend
run: |
timeout 30 bash -c 'until curl -s http://127.0.0.1:8000/; do sleep 1; done'
# Run the tests against the local application
- name: Install dependencies and Run tests
working-directory: ./backend
env:
API_BASE_URL: "http://127.0.0.1:8000"
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pytest