Project TS #374
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: API Test | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
if: github.event.pull_request.draft == false | |
timeout-minutes: 60 | |
env: | |
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.LULCCI_ASCS }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Docker Pull | |
run: docker-compose pull | |
- name: Docker Layer Caching | |
uses: satackey/[email protected] | |
continue-on-error: true | |
- name: Docker Build | |
run: docker-compose up --build -d postgis | |
- name: Docker API Build | |
run: docker build -t api services/api | |
- name: Docker API Lint | |
run: docker run api sh -c "npm install --include=dev && npm run lint" | |
- name: Docker API Test | |
run: docker run --network pearl-backend_default | |
-e "Postgres=postgres://docker:docker@postgis:5432/gis" | |
-e "AZURE_STORAGE_CONNECTION_STRING=${{ secrets.LULCCI_ASCS }}" | |
api npm test | |
- name: Docker Cleanup | |
run: docker-compose kill | |