diff --git a/.github/workflows/api_testing.yml b/.github/workflows/run_coverage.yml similarity index 91% rename from .github/workflows/api_testing.yml rename to .github/workflows/run_coverage.yml index e7c40a6..4b52640 100644 --- a/.github/workflows/api_testing.yml +++ b/.github/workflows/run_coverage.yml @@ -1,5 +1,5 @@ name: Run Tests -on: [push, pull_request] +on: [pull_request] jobs: test: permissions: @@ -43,13 +43,9 @@ jobs: format: markdown - name: Add Coverage PR Comment uses: marocchino/sticky-pull-request-comment@v2 - if: github.event_name == 'pull_request' with: recreate: true path: code-coverage-results.md - name: Stop Server run: | - kill $(jobs -p) || true - - - + kill $(jobs -p) || true \ No newline at end of file diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml new file mode 100644 index 0000000..05e3aa8 --- /dev/null +++ b/.github/workflows/run_tests.yml @@ -0,0 +1,38 @@ +name: Run Tests +on: [push, pull_request] +jobs: + test: + permissions: + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install poetry + run: | + pip install poetry + - name: Syncify Client + run: | + python scripts/syncronizer.py + - name: Start Server + run: | + cd api + poetry install --no-root + poetry run uvicorn src.main:app & + sleep 5 + cd .. + env: + DATABASE_TYPE: sqlite + CONNECTION_URI: sqlite:///api.db + - name: Run Tests + run: | + cd sdk + poetry install + poetry run pytest + cd .. + - name: Stop Server + run: | + kill $(jobs -p) || true \ No newline at end of file