Merge pull request #85 from NASA-AMMOS/feature--collaborators #198
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: Test | |
on: | |
pull_request: | |
push: | |
branches: | |
- develop | |
tags: | |
- v* | |
workflow_dispatch: | |
env: | |
AERIE_USERNAME: "${{secrets.AERIE_USERNAME}}" | |
AERIE_PASSWORD: "${{secrets.AERIE_PASSWORD}}" | |
HASURA_GRAPHQL_ADMIN_SECRET: "${{secrets.HASURA_GRAPHQL_ADMIN_SECRET}}" | |
HASURA_GRAPHQL_JWT_SECRET: "${{secrets.HASURA_GRAPHQL_JWT_SECRET}}" | |
POSTGRES_USER: "${{secrets.POSTGRES_USER}}" | |
POSTGRES_PASSWORD: "${{secrets.POSTGRES_PASSWORD}}" | |
DOCKER_TAG: "v1.12.0" | |
REPOSITORY_DOCKER_URL: "ghcr.io/nasa-ammos" | |
jobs: | |
unit-test: | |
runs-on: ubuntu-20.04 | |
environment: integration-test-workflow | |
strategy: | |
matrix: | |
python-version: [ "3.6.15", "3.7", "3.8", "3.9", "3.10", "3.11" ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
pip install . | |
- name: Test with pytest | |
run: | | |
cd tests | |
pytest unit_tests | |
integration-test: | |
timeout-minutes: 10 | |
runs-on: ubuntu-20.04 | |
environment: integration-test-workflow | |
strategy: | |
matrix: | |
python-version: [ "3.6.15", "3.11" ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
pip install . | |
- name: Set up aerie instance | |
run: | | |
docker compose -f docker-compose-test.yml up -d | |
docker images | |
docker ps -a | |
- name: Sleep for 60 Seconds | |
run: sleep 60s | |
shell: bash | |
- name: Run integration tests | |
run: | | |
cd tests | |
pytest integration_tests | |
- name: Print service logs | |
if: always() | |
run: docker compose -f docker-compose-test.yml logs -t | |
- name: Stop services | |
if: always() | |
run: | | |
docker ps -a | |
docker compose -f docker-compose-test.yml down | |
docker ps -a | |
- name: Prune volumes | |
if: always() | |
run: docker volume prune --force |