diff --git a/.github/workflows/btr-api-ci.yml b/.github/workflows/btr-api-ci.yml index e2f3a9be..dc3fa951 100644 --- a/.github/workflows/btr-api-ci.yml +++ b/.github/workflows/btr-api-ci.yml @@ -34,60 +34,64 @@ jobs: poetry run pylint --rcfile=setup.cfg src/btr_api poetry run flake8 src/btr_api - # unit-testing: - # env: - # DATABASE_TEST_USERNAME: postgres - # DATABASE_TEST_PASSWORD: postgres - # DATABASE_TEST_NAME: btr_test - # DATABASE_TEST_HOST: db - # DATABASE_TEST_PORT: 5432 - - # runs-on: ubuntu-20.04 + unit-testing: + env: + DATABASE_TEST_USERNAME: postgres + DATABASE_TEST_PASSWORD: postgres + DATABASE_TEST_NAME: btr + DATABASE_TEST_HOST: localhost + DATABASE_TEST_PORT: 5432 + DATABASE_USERNAME: postgres + DATABASE_PASSWORD: postgres + DATABASE_HOST: localhost + DATABASE_PORT: 5432 + + runs-on: ubuntu-20.04 - # services: - # postgres: - # image: postgres:12 - # env: - # POSTGRES_USER: postgres - # POSTGRES_PASSWORD: postgres - # POSTGRES_DB: postgres - # ports: - # - 5432:5432 - # options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - - # steps: - # - name: Checkout code - # uses: actions/checkout@v3 - - # - name: Set up Python - # uses: actions/setup-python@v2 - # with: - # python-version: 3.11 - - # - name: Install Poetry - # uses: snok/install-poetry@v1 - - # - name: Install dependencies - # run: poetry install + services: + postgres: + image: postgres:12 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: btr + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.11 + + - name: Install Poetry + uses: snok/install-poetry@v1 + + - name: Install dependencies + run: poetry install - # - name: Update db - # run: | - # poetry run flask db upgrade - # poetry run flask db migrate + - name: Update db + run: | + poetry run flask db upgrade + poetry run flask db migrate - # - name: Run tests - # run: poetry run pytest --cov=./ --cov-report=xml + - name: Run tests + run: poetry run pytest --cov=./ --cov-report=xml - # - name: Check coverage - # run: poetry run coverage report --fail-under=80 + - name: Check coverage + run: poetry run coverage report --fail-under=80 - # - name: Upload coverage to Codecov - # uses: codecov/codecov-action@v3 - # with: - # file: ./btr-api/coverage.xml - # flags: btr-api - # name: codecov-btr-api - # fail_ci_if_error: false + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + file: ./btr-api/coverage.xml + flags: btr-api + name: codecov-btr-api + fail_ci_if_error: false build: runs-on: ubuntu-20.04 diff --git a/btr-api/.env b/btr-api/.env deleted file mode 100644 index bd948673..00000000 --- a/btr-api/.env +++ /dev/null @@ -1,37 +0,0 @@ -# third party Services -#SENTRY_DSN= -#CODECOV_TOKEN= -#LD_SDK_KEY= - -# Registry Integration Services -PAYMENT_SVC_URL= -AUTH_SVC_URL= -REPORT_SVC_URL= - -# Flask shite -FLASK_ENV=development -FLASK_APP=wsgi.py -SECRET=some md5 hash -APP_SETTINGS=dev - -# SQL Alchemy -DATABASE_USERNAME=postgres -DATABASE_PASSWORD=postgres -DATABASE_NAME=btr -DATABASE_HOST=db -DATABASE_PORT=5432 - -## TEST DB -DATABASE_TEST_USERNAME=postgres -DATABASE_TEST_PASSWORD=postgres -DATABASE_TEST_NAME=btr_test -DATABASE_TEST_HOST=db -DATABASE_TEST_PORT=5432 - -# JWT Settings -JWT_OIDC_WELL_KNOWN_CONFIG= -JWT_OIDC_ALGORITHMS=RS256 -JWT_OIDC_AUDIENCE= -JWT_OIDC_CLIENT_SECRET= -JWT_OIDC_CACHING_ENABLED=True -JWT_OIDC_JWKS_CACHE_TIMEOUT=300