-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (56 loc) · 2.16 KB
/
unittest.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: unittest
on: [push]
jobs:
run-unittests:
permissions:
id-token: write # This is required for requesting the JWT for gaining permissions to assume the IAM role to perform AWS actions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- uses: actions/setup-python@v4
name: setup python
with:
python-version: 3.11
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements.dev.txt
- name: AWS credentials configuration
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{secrets.GH_ACTIONS_AWS_ROLE}}
role-session-name: gh-actions-${{github.run_id}}.${{github.run_number}}.${{github.run_attempt}}-unittest
aws-region: us-east-1
- name: Amazon ECR login
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: run unit tests
env:
ENV_STATE: test
HOST: 0.0.0.0
PSQL_USERNAME: postgres
PSQL_PASSWORD: postgres
PSQL_HOST: localhost
PSQL_PORT: 5432
PSQL_DATABASE: literature-test
PYTHONPATH: agr_literature_service/lit_processing/
OKTA_DOMAIN: 'dev-30456587.okta.com/oauth2/default'
OKTA_API_AUDIENCE: 'api://default'
RESOURCE_DESCRIPTOR_URL: 'https://raw.githubusercontent.com/alliance-genome/agr_schemas/master/resourceDescriptors.yaml'
ELASTICSEARCH_HOST: localhost
ELASTICSEARCH_PORT: 9200
ELASTICSEARCH_INDEX: references_index
XML_PATH: ${GITHUB_WORKSPACE}/tests/tmp/
OKTA_CLIENT_ID: ${{ secrets.okta_client_id }}
OKTA_CLIENT_SECRET: ${{ secrets.okta_client_secret }}
run: |
docker compose --env-file .env.test down -v
docker compose --env-file .env.test up -d postgres
sleep 5
docker compose --env-file .env.test up -d elasticsearch
sleep 10
pytest -m "not webtest"
docker compose --env-file .env.test down -v