Skip to content

Commit

Permalink
Run api and logger tests separately on GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ukanga committed Jul 3, 2024
1 parent f99061c commit 089289f
Showing 1 changed file with 10 additions and 60 deletions.
70 changes: 10 additions & 60 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,65 +50,15 @@ jobs:

- name: Run Prospector
run: prospector -X -s veryhigh onadata
unit-tests-1:
name: Django Unit Tests (Libraries, Main, RestServices, SMS Support, Viewer, Messaging)
runs-on: ubuntu-22.04
needs: static-analysis
env:
DJANGO_SETTINGS_MODULE: onadata.settings.github_actions_test
services:
postgres:
image: postgis/postgis:13-3.0
env:
POSTGRES_PASSWORD: onadata
POSTGRES_DB: onadata
POSTGRES_USER: onadata
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "8"

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: "x64"
cache: "pip"
cache-dependency-path: |
requirements/base.pip
requirements/dev.pip
requirements/azure.pip
- name: Update apt sources
run: sudo apt-get update

- name: Install APT requirements
run: sudo apt-get install -y --no-install-recommends libjpeg-dev zlib1g-dev software-properties-common ghostscript libxslt1-dev binutils libproj-dev gdal-bin memcached libmemcached-dev libxml2-dev libxslt-dev

- name: Install Pip requirements
run: |
pip install -U pip
pip install -r requirements/base.pip
pip install -r requirements/dev.pip
- name: Run tests
run: |
python manage.py test onadata/libs onadata/apps/main onadata/apps/restservice onadata/apps/sms_support onadata/apps/viewer onadata/apps/messaging --noinput --timing --settings=onadata.settings.github_actions_test --verbosity=2 --parallel=4
unit-tests-2:
name: Django Unit Tests (API, Logger)
unit-tests:
strategy:
fail-fast: false
matrix:
test_path:
- [" Django Unit Tests (Libraries, Main, RestServices, SMS Support, Viewer, Messaging)", "python manage.py test onadata/libs onadata/apps/main onadata/apps/restservice onadata/apps/sms_support onadata/apps/viewer onadata/apps/messaging --noinput --timing --settings=onadata.settings.github_actions_test --verbosity=2 --parallel=4"]
- ["Django Unit Tests API", "python manage.py test onadata/apps/api --noinput --timing --settings=onadata.settings.github_actions_test --verbosity=2 --parallel=4"]
- ["Django Unit Tests Logger", "python manage.py test onadata/apps/logger --noinput --timing --settings=onadata.settings.github_actions_test --verbosity=2 --parallel=4"]
name: "${{ matrix.test_path[0] }}"
runs-on: ubuntu-22.04
needs: static-analysis
env:
Expand Down Expand Up @@ -164,7 +114,7 @@ jobs:
- name: Run tests
run: |
python manage.py test onadata/apps/api onadata/apps/logger --noinput --timing --settings=onadata.settings.github_actions_test --verbosity=2 --parallel=4
${{ matrix.test_path[1] }}
security-check:
name: Trivy Security Checks
runs-on: ubuntu-22.04
Expand Down

0 comments on commit 089289f

Please sign in to comment.