Skip to content

Merge branch 'main' into develop #29

Merge branch 'main' into develop

Merge branch 'main' into develop #29

# Runs a build test every time a commit is pushed to branch 'develop'.
# Runs a build test and merges develop into main every time a tag with pattern 'v*' is pushed.
name: Merge to Main
on:
push:
tags:
- v*
jobs:
build-test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
db: [sqlite, mysql] # postgres
python-version: [3.8, 3.10.4]
include:
- db: mysql
db_port: 3306
db_engine: django.db.backends.mysql
db_user: root
services:
mysql:
image: mysql
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: ddmtestdb
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install psycopg2 mysqlclient
- name: Run Tests With ${{ matrix.db }}
env:
DB: ${{ matrix.db }}
DB_ENGINE: ${{ matrix.db_engine }}
DB_NAME: ddmtestdb
DB_USER: ${{ matrix.db_user }}
DB_PASSWORD: password
DB_PORT: ${{ matrix.db_port }}
run: |
python test_project/manage.py test ddm
publish-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install Antora
run: npm i antora
- name: Generate Site
run: npx antora docs/antora-playbook.yml
- name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/site
merge-dev:
needs: build-test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: everlytic/branch-merge@1.1.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_ref: 'develop'
target_branch: 'main'
commit_message_template: '[Automated] Merged {source_ref} into target {target_branch}'