Skip to content

Commit

Permalink
Merge pull request #2 from rossumai/rehoumir-add-ci
Browse files Browse the repository at this point in the history
Create python-app.yml
  • Loading branch information
rehoumir authored Jul 12, 2024
2 parents f7c8a20 + 1443139 commit d24b2b6
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 10 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

name: Run Tests & Deploy
on: [push]

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install poetry && poetry config virtualenvs.create false
python -m venv /opt/venv
poetry install --no-interaction --no-root
- name: Install packages needed for CI
run: pip install pre-commit pytest
- name: Lint all files
run: pre-commit run --all-files --show-diff-on-failure
- name: Run tests
env:
SOURCE_API_BASE: ${{secrets.SOURCE_API_BASE}}
SOURCE_USERNAME: ${{secrets.SOURCE_USERNAME}}
SOURCE_PASSWORD: ${{secrets.SOURCE_PASSWORD}}
TARGET_API_BASE: ${{secrets.TARGET_API_BASE}}
TARGET_USERNAME: ${{secrets.TARGET_USERNAME}}
TARGET_PASSWORD: ${{secrets.TARGET_PASSWORD}}
run: pytest tests
12 changes: 6 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

from project_rossum_deploy.utils.consts import settings

base_url = os.getenv("SOURCE_API_BASE")
username = os.getenv("SOURCE_USERNAME")
password = os.getenv("SOURCE_PASSWORD")
base_url = os.environ.get("SOURCE_API_BASE")
username = os.environ.get("SOURCE_USERNAME")
password = os.environ.get("SOURCE_PASSWORD")


@pytest.fixture
Expand All @@ -25,9 +25,9 @@ def client():
)


target_base_url = os.getenv("TARGET_API_BASE")
target_username = os.getenv("TARGET_USERNAME")
target_password = os.getenv("TARGET_PASSWORD")
target_base_url = os.environ.get("TARGET_API_BASE")
target_username = os.environ.get("TARGET_USERNAME")
target_password = os.environ.get("TARGET_PASSWORD")


@pytest.fixture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@
"token_lifetime_s": null,
"hook_template": "https://shared-eu2.rossum.app/api/v1/hook_templates/30",
"modified_by": "https://shared-eu2.rossum.app/api/v1/users/285991",
"modified_at": "2024-07-10T10:42:18.694227Z"
"modified_at": "2024-07-12T09:49:33.794716Z"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@
"token_lifetime_s": null,
"hook_template": null,
"modified_by": "https://shared-eu2.rossum.app/api/v1/users/285991",
"modified_at": "2024-07-10T10:42:18.807925Z"
"modified_at": "2024-07-12T10:06:50.465784Z"
}
2 changes: 1 addition & 1 deletion tests/reference_project/source/organization.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
"creator": "https://shared-eu2.rossum.app/api/v1/users/285991",
"settings": {},
"modified_by": "https://shared-eu2.rossum.app/api/v1/users/285991",
"modified_at": "2024-07-10T10:42:18.292114Z"
"modified_at": "2024-07-12T10:06:09.185846Z"
}
Original file line number Diff line number Diff line change
Expand Up @@ -1202,5 +1202,5 @@
],
"metadata": {},
"modified_by": "https://shared-eu2.rossum.app/api/v1/users/285991",
"modified_at": "2024-07-10T10:42:17.178452Z"
"modified_at": "2024-07-12T10:12:41.185402Z"
}
2 changes: 2 additions & 0 deletions tests/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ async def setup_project(client: ElisAPIClient, tmp_path):
current_path = Path(__file__).parent.parent
os.chdir(tmp_path)
subprocess.run(["git", "init"])
subprocess.run(["git", "config", "user.email", "gh_pipeline_runner"])
subprocess.run(["git", "config", "user.name", "gh_pipeline_runner"])
subprocess.run(["git", "add", "."])
subprocess.run(["git", "commit", "-m", "init"])
os.chdir(current_path)
Expand Down

0 comments on commit d24b2b6

Please sign in to comment.