Skip to content

Update unit tests for local use #37

Update unit tests for local use

Update unit tests for local use #37

Workflow file for this run

name: ci
on:
- push
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install package
run: |
pip install pip-tools>=6.2.0
pip-sync requirements.txt dev-requirements.txt
pip install .
- name: Run commit-blocking lint checks
run: |
# Run pre-commit hooks. We have to be a little careful here with
# pip-compile: if we ran it with --all-files, it would run
# pip-compile on every pull, which would update the pinned
# dependencies if any have changed - even if the requirements.in
# files are unchanged.
#
# Run everything except pip-compile against all files
SKIP=pip-compile pre-commit run --all-files
# Run pip-compile - but only if requirements.in or
# dev-requirements.in have changed in this pull request's diff.
pre-commit run pip-compile --from-ref=$GITHUB_BASE_REF --to-ref=$GITHUB_HEAD_REF
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install package
run: |
pip install pip-tools>=6.2.0
pip-sync requirements.txt dev-requirements.txt
pip install .
- name: Run unit tests
run: pytest
integration-test:
runs-on: ubuntu-latest
concurrency: integration-test
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Set up AWS credentials (for local environment)
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Install package
run: |
pip install pip-tools>=6.2.0
pip-sync requirements.txt dev-requirements.txt
pip install .
- name: Run integration tests
run: pytest
env:
ALERTDB_TEST_ENDPOINT: ${{ secrets.GCP_PROJECT_ID }}