diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index efde205e..cfeddcf8 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -21,30 +21,28 @@ jobs: test: runs-on: ubuntu-latest needs: build - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: password - POSTGRES_DB: db_name + env + TEST_USERNAME: postgres + TEST_PASSWORD: password + TEST_DB_NAME: db_name + TEST_DB_HOST: localhost + TEST_DB_PORT: 5432 + TEST_DB_CONNECTION: pgsql + TEST_TIMEZONE: Africa/Lagos + TEST_SSLMODE: disable + TEST_MIGRATE: true services: postgres: image: postgres:latest env: - POSTGRES_USER: ${{ env.POSTGRES_USER }} - POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} - POSTGRES_DB: ${{ env.POSTGRES_DB }} + POSTGRES_USER: ${{ env.TEST_USERNAME }} + POSTGRES_PASSWORD: ${{ env.TEST_PASSWORD }} + POSTGRES_DB: ${{ env.TEST_DB_NAME }} ports: - - 5432:5432 + - ${{ env.TEST_DB_PORT }}:5432 steps: - name: Checkout Code uses: actions/checkout@v4 - - name: Create the app config file - run: cp app-sample.env app.env - - name: Run The Project - run: nohup go run main.go > /dev/null 2>&1 & - - name: Wait for application to start - run: sleep 30s - - name: Test for reachability - run: curl http://localhost:8019 - name: Run All Tests run: go test ./... -timeout 99999s