Skip to content

Commit

Permalink
ci/cd (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
hemidactylus authored Feb 8, 2024
1 parent ec8bb23 commit d7df865
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Lint

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
mypy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Src Ruff
run: |
cd src/ && ruff .
- name: Src Black
run: |
cd src/ && black . --check
- name: Src Mypy
run: |
cd src/ && mypy .
- name: Test Ruff
run: |
cd tests/ && ruff .
- name: Test Black
run: |
cd tests/ && black . --check
- name: Test Mypy
run: |
cd tests/ && mypy .
46 changes: 46 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test with Astra DB

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
env:
ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }}
ASTRA_DB_DATABASE_ID: ${{ secrets.ASTRA_DB_DATABASE_ID }}
ASTRA_DB_INIT_STRING: ${{ secrets.ASTRA_DB_INIT_STRING }}
ASTRA_DB_KEYSPACE: ${{ secrets.ASTRA_DB_KEYSPACE }}
ASTRA_DB_SECURE_BUNDLE_PATH: ${{ secrets.ASTRA_DB_SECURE_BUNDLE_PATH }}
TEST_DB_MODE: ${{ secrets.TEST_DB_MODE }}
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.10

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Get SCB
run: |
python -c 'import os; from cassio.config.bundle_download import download_astra_bundle_url; download_astra_bundle_url(database_id=os.environ["ASTRA_DB_DATABASE_ID"], token=os.environ["ASTRA_DB_APPLICATION_TOKEN"], out_file_path=os.environ["ASTRA_DB_SECURE_BUNDLE_PATH"])'
- name: Unit tests
run: |
pytest tests/unit
- name: Integration tests
run: |
pytest tests/integration

0 comments on commit d7df865

Please sign in to comment.