From 6106bae51b9ac95764b47334972935a88154ce47 Mon Sep 17 00:00:00 2001 From: David Bozhanov <35780021+davnov015@users.noreply.github.com> Date: Mon, 10 Jun 2024 16:41:14 -0500 Subject: [PATCH] Create django.yml --- .github/workflows/django.yml | 65 ++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/django.yml diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml new file mode 100644 index 0000000..21a133a --- /dev/null +++ b/.github/workflows/django.yml @@ -0,0 +1,65 @@ +name: Django CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [3.7, 3.8, 3.9, 3.10] + db: [postgres, mysql] + include: + - db: postgres + db_port: 5432 + - db: mysql + db_port: 3306 + services: + postgres: + image: postgres:16 + ports: + - 5432:5432 + env: + POSTGRES_USER: permagate + POSTGRES_PASSWORD: SpYkxYy1dMmo7Bk + options: + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + mysql: + image: mysql:8 + ports: + - 3306:3306 + env: + MYSQL_ROOT_PASSWORD: SpYkxYy1dMmo7Bk + MYSQL_USER: permagate + MYSQL_PASSWORD: SpYkxYy1dMmo7Bk + options: + --health-cmd "mysqladmin ping" + --health-interval 10s + --health-timeout 5s + --health-retries 3 + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + env: + DATABASE_URL: ${{ matrix.db }}://permagate:SpYkxYy1dMmo7Bk@127.0.0.1:${{ matrix.db_port }}/permagate + - name: Run Tests + run: | + python manage.py test