Skip to content

Commit

Permalink
first attempt at CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mpnowacki-reef committed Jan 2, 2024
1 parent 2717856 commit d718799
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Continuous Integration

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: download wallets
run: aws s3 sync s3://$WALLET_BUCKET ~/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
WALLET_BUCKET: ${{ secrets.WALLET_BUCKET }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade nox pip setuptools
- name: Run tests
run: nox -s test
env:
RICH_TRACEBACK: 0
CORTEXT_MINER_ADDITIONAL_WHITELIST_VALIDATOR_KEYS: ${{ secrets.VALIDATOR_KEY }}
WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ By leveraging synthetic data, Cortex.t circumvents the traditional challenges of
Join us at Cortex.t, your bridge to AI excellence, and democratise access to top-level AI capabilities. Be part of the AI revolution and stay at the forefront of innovation with SynthPairPro – Synthesizing Intelligence, Empowering the Future!


## Development

### Testing

install `nox` (`pip install nox`) and run `nox -s test`.

## Setup

### Before you proceed
Expand Down
22 changes: 22 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pathlib

import nox

REQUIREMENTS_TEST = [
"pytest==7.*",
]


def install_myself(session):
"""Install from source."""
session.run('pip', 'install', '-e', '.')


THIS_DIR = str(pathlib.Path(__file__).parent)


@nox.session(reuse_venv=True)
def test(session):
install_myself(session)
session.run('pip', 'install', *REQUIREMENTS_TEST)
session.run('pytest', 'tests', '-rP', '-vv', *session.posargs, env={'RICH_TRACEBACK': '0', 'PYTHONPATH': THIS_DIR})
Empty file removed tests/conftest.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def test_text_validator(self):
resp = requests.post(
f'http://localhost:{VALIDATOR_PORT}/text-validator/',
headers={'access-key': 'hello'},
json={'1': 'please write a sentence using the word "cucumber"'}
json={'1': 'please write a sentence using the word "cucumber"'},
timeout=15,
)
resp.raise_for_status()
assert "cucumber" in resp.text
print(resp.text)

0 comments on commit d718799

Please sign in to comment.