Skip to content

Merging develop branch into main #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/Gitflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Git Flow CI

on:
push:
branches:
- develop
- main
- 'feature/*'
- 'release/*'

permissions:
contents: write

jobs:
build:
uses: ./.github/workflows/workflow.yml
with:
python-version: '3.12'
secrets:
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_NAME: ${{ secrets.DB_NAME }}

release:
name: Create Release Tag
if: startsWith(github.ref, 'refs/heads/release/')
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create release tag
env:
GIT_TAG: "v$(date +'%Y.%m.%d.%H%M')"
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag $GIT_TAG
git push origin $GIT_TAG
42 changes: 42 additions & 0 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

name: Trunk CI

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: write

jobs:
build:
uses: ./.github/workflows/workflow.yml
with:
python-version: '3.12'
secrets:
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_NAME: ${{ secrets.DB_NAME }}

release:
name: Create Release Tag
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create release tag
env:
GIT_TAG: "v$(date +'%Y.%m.%d.%H%M')"
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag $GIT_TAG
git push origin $GIT_TAG
65 changes: 65 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

name: CI Workflow

on:
workflow_call:
inputs:
python-version:
required: true
type: string
secrets:
DB_USER:
required: true
DB_PASSWORD:
required: true
DB_NAME:
required: true

jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: ${{ secrets.DB_USER }}
POSTGRES_PASSWORD: ${{ secrets.DB_PASSWORD }}
POSTGRES_DB: ${{ secrets.DB_NAME }}
ports:
- 5432:5432

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run migrations
env:
DJANGO_SETTINGS_MODULE: "Videogames_project.settings"
DB_NAME: ${{ secrets.DB_NAME }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_HOST: localhost
DB_PORT: "5432"
run: |
python manage.py migrate --noinput

- name: Run tests
env:
DJANGO_SETTINGS_MODULE: "Videogames_project.settings"
DB_NAME: ${{ secrets.DB_NAME }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_HOST: localhost
DB_PORT: "5432"
run: |
python manage.py test --verbosity=2
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

.venv/
.idea/
.vscode/
__pycache__/
*.pyc

# Ignore the credentials (for obvious reasons)
credentials.env
videogames_register/migrations/__pycache__/
Videogames_project/__pycache__/
34 changes: 0 additions & 34 deletions .idea/Videogames_project.iml

This file was deleted.

Loading
Loading