From bd41dfc1c2bcb48e90397f18b471ac5369abf411 Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Thu, 25 Jan 2024 17:31:59 -0500 Subject: [PATCH] Attempting to get E2E work with local API Signed-off-by: Carlo Costino --- .github/workflows/checks.yml | 103 ++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 22b3b8ae7..d68df41ad 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -53,65 +53,66 @@ jobs: pull-requests: write contents: write runs-on: ubuntu-latest - # services: - # postgres: - # image: postgres - # env: - # POSTGRES_USER: user - # POSTGRES_PASSWORD: password - # POSTGRES_DB: test_notification_api - # options: >- - # --health-cmd pg_isready - # --health-interval 10s - # --health-timeout 5s - # --health-retries 5 - # ports: - # # Maps tcp port 5432 on service container to the host - # - 5432:5432 - # redis: - # image: redis - # options: >- - # --health-cmd "redis-cli ping" - # --health-interval 10s - # --health-timeout 5s - # --health-retries 5 - # ports: - # # Maps tcp port 6379 on service container to the host - # - 6379:6379 + services: + postgres: + image: postgres + env: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: test_notification_api + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 6379 on service container to the host + - 6379:6379 steps: - uses: actions/checkout@v3 - uses: ./.github/actions/setup-project - uses: jwalton/gh-find-current-pr@v1 id: findPr - # - name: Clone API - # uses: actions/checkout@v3 - # with: - # repository: GSA/notifications-api - # path: 'notifications-api' - # - name: Install API dependencies - # working-directory: 'notifications-api' - # run: make bootstrap - # env: - # DATABASE_URL: postgresql://user:password@localhost:5432/test_notification_api - # SQLALCHEMY_DATABASE_TEST_URI: postgresql://user:password@localhost:5432/test_notification_api - # REDIS_URL: redis://localhost:6379 - # NOTIFY_E2E_TEST_EMAIL: ${{ secrets.NOTIFY_E2E_TEST_EMAIL }} - # NOTIFY_E2E_TEST_PASSWORD: ${{ secrets.NOTIFY_E2E_TEST_PASSWORD }} - # NOTIFY_ENVIRONMENT: development - # - name: Run API server - # working-directory: 'notifications-api' - # run: make run-procfile & - # env: - # DATABASE_URL: postgresql://user:password@localhost:5432/test_notification_api - # SQLALCHEMY_DATABASE_TEST_URI: postgresql://user:password@localhost:5432/test_notification_api - # REDIS_URL: redis://localhost:6379 - # NOTIFY_E2E_TEST_EMAIL: ${{ secrets.NOTIFY_E2E_TEST_EMAIL }} - # NOTIFY_E2E_TEST_PASSWORD: ${{ secrets.NOTIFY_E2E_TEST_PASSWORD }} - # NOTIFY_ENVIRONMENT: development + - name: Clone API + uses: actions/checkout@v3 + with: + repository: GSA/notifications-api + path: 'notifications-api' + - name: Install API dependencies + working-directory: 'notifications-api' + run: make bootstrap + env: + DATABASE_URL: postgresql://user:password@localhost:5432/test_notification_api + SQLALCHEMY_DATABASE_TEST_URI: postgresql://user:password@localhost:5432/test_notification_api + REDIS_URL: redis://localhost:6379 + NOTIFY_E2E_TEST_EMAIL: ${{ secrets.NOTIFY_E2E_TEST_EMAIL }} + NOTIFY_E2E_TEST_PASSWORD: ${{ secrets.NOTIFY_E2E_TEST_PASSWORD }} + NOTIFY_ENVIRONMENT: staging + - name: Run API server + working-directory: 'notifications-api' + run: make run-procfile & + env: + DATABASE_URL: postgresql://user:password@localhost:5432/test_notification_api + SQLALCHEMY_DATABASE_TEST_URI: postgresql://user:password@localhost:5432/test_notification_api + REDIS_URL: redis://localhost:6379 + NOTIFY_E2E_TEST_EMAIL: ${{ secrets.NOTIFY_E2E_TEST_EMAIL }} + NOTIFY_E2E_TEST_PASSWORD: ${{ secrets.NOTIFY_E2E_TEST_PASSWORD }} + NOTIFY_ENVIRONMENT: staging - name: Run Admin server run: make run-flask & env: - API_HOST_NAME: https://notify-api-staging.app.cloud.gov + # API_HOST_NAME: https://notify-api-staging.app.cloud.gov + API_HOST_NAME: http://localhost:6011 DANGEROUS_SALT: ${{ secrets.DANGEROUS_SALT }} SECRET_KEY: ${{ secrets.SECRET_KEY }} ADMIN_CLIENT_SECRET: ${{ secrets.ADMIN_CLIENT_SECRET }}