new-ddm-version #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bump DDM | |
on: | |
repository_dispatch: | |
types: [new-ddm-version] | |
jobs: | |
test-and-bump-ddm: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: ${{ secrets.DJANGO_DB_USER }} | |
POSTGRES_PASSWORD: ${{ secrets.DJANGO_DB_PW }} | |
POSTGRES_DB: ${{ secrets.DJANGO_DB_NAME }} | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.client_payload.ref }} | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Switch to dev branch | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git fetch --all | |
git pull --all | |
git checkout dev | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install --upgrade django-ddm | |
- name: Run migrations and collect static files | |
env: | |
DJANGO_SECRET: ${{ secrets.DJANGO_SECRET }} | |
DJANGO_SETTINGS_MODULE: ${{ secrets.DJANGO_SETTINGS_MODULE }} | |
DJANGO_DB_NAME: ${{ secrets.DJANGO_DB_NAME }} | |
DJANGO_DB_USER: ${{ secrets.DJANGO_DB_USER }} | |
DJANGO_DB_PW: ${{ secrets.DJANGO_DB_PW }} | |
OIDC_RP_CLIENT_ID: ${{ secrets.OIDC_RP_CLIENT_ID }} | |
OIDC_RP_CLIENT_SECRET: ${{ secrets.OIDC_RP_CLIENT_SECRET }} | |
run: | | |
python manage.py migrate | |
python manage.py collectstatic | |
- name: Run tests | |
env: | |
DJANGO_SECRET: ${{ secrets.DJANGO_SECRET }} | |
DJANGO_SETTINGS_MODULE: ${{ secrets.DJANGO_SETTINGS_MODULE }} | |
DJANGO_DB_NAME: ${{ secrets.DJANGO_DB_NAME }} | |
DJANGO_DB_USER: ${{ secrets.DJANGO_DB_USER }} | |
DJANGO_DB_PW: ${{ secrets.DJANGO_DB_PW }} | |
OIDC_RP_CLIENT_ID: ${{ secrets.OIDC_RP_CLIENT_ID }} | |
OIDC_RP_CLIENT_SECRET: ${{ secrets.OIDC_RP_CLIENT_SECRET }} | |
run: python manage.py test ddm | |
- name: Update requirements and commit to dev | |
run: | | |
newddmversion=$(pip show django-ddm | grep Version: | cut -d' ' -f2 ) | |
sed -i "s/django-ddm.*/django-ddm==$newddmversion/" requirements.txt | |
git add . | |
git commit -m "[automated]: Bump django-ddm version in requirements.txt." | |
git push | |
- name: Merge dev into stage | |
run: | | |
git checkout stage | |
git merge dev | |
git push |