Skip to content

Commit e7fd767

Browse files
authored
Merge pull request #3 from Marrrco7/develop
Merging develop branch into main
2 parents 253bb08 + 01eb29e commit e7fd767

File tree

146 files changed

+166
-33608
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+166
-33608
lines changed

.github/workflows/Gitflow.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Git Flow CI
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- main
8+
- 'feature/*'
9+
- 'release/*'
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
build:
16+
uses: ./.github/workflows/workflow.yml
17+
with:
18+
python-version: '3.12'
19+
secrets:
20+
DB_USER: ${{ secrets.DB_USER }}
21+
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
22+
DB_NAME: ${{ secrets.DB_NAME }}
23+
24+
release:
25+
name: Create Release Tag
26+
if: startsWith(github.ref, 'refs/heads/release/')
27+
needs: build
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
34+
- name: Create release tag
35+
env:
36+
GIT_TAG: "v$(date +'%Y.%m.%d.%H%M')"
37+
run: |
38+
git config user.name "github-actions[bot]"
39+
git config user.email "github-actions[bot]@users.noreply.github.com"
40+
git tag $GIT_TAG
41+
git push origin $GIT_TAG

.github/workflows/trunk.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
name: Trunk CI
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
build:
17+
uses: ./.github/workflows/workflow.yml
18+
with:
19+
python-version: '3.12'
20+
secrets:
21+
DB_USER: ${{ secrets.DB_USER }}
22+
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
23+
DB_NAME: ${{ secrets.DB_NAME }}
24+
25+
release:
26+
name: Create Release Tag
27+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
28+
needs: build
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v4
34+
35+
- name: Create release tag
36+
env:
37+
GIT_TAG: "v$(date +'%Y.%m.%d.%H%M')"
38+
run: |
39+
git config user.name "github-actions[bot]"
40+
git config user.email "github-actions[bot]@users.noreply.github.com"
41+
git tag $GIT_TAG
42+
git push origin $GIT_TAG

.github/workflows/workflow.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
name: CI Workflow
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
python-version:
8+
required: true
9+
type: string
10+
secrets:
11+
DB_USER:
12+
required: true
13+
DB_PASSWORD:
14+
required: true
15+
DB_NAME:
16+
required: true
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
services:
22+
postgres:
23+
image: postgres:13
24+
env:
25+
POSTGRES_USER: ${{ secrets.DB_USER }}
26+
POSTGRES_PASSWORD: ${{ secrets.DB_PASSWORD }}
27+
POSTGRES_DB: ${{ secrets.DB_NAME }}
28+
ports:
29+
- 5432:5432
30+
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v4
34+
35+
- name: Set up Python
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: ${{ inputs.python-version }}
39+
40+
- name: Install dependencies
41+
run: |
42+
python -m pip install --upgrade pip
43+
pip install -r requirements.txt
44+
45+
- name: Run migrations
46+
env:
47+
DJANGO_SETTINGS_MODULE: "Videogames_project.settings"
48+
DB_NAME: ${{ secrets.DB_NAME }}
49+
DB_USER: ${{ secrets.DB_USER }}
50+
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
51+
DB_HOST: localhost
52+
DB_PORT: "5432"
53+
run: |
54+
python manage.py migrate --noinput
55+
56+
- name: Run tests
57+
env:
58+
DJANGO_SETTINGS_MODULE: "Videogames_project.settings"
59+
DB_NAME: ${{ secrets.DB_NAME }}
60+
DB_USER: ${{ secrets.DB_USER }}
61+
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
62+
DB_HOST: localhost
63+
DB_PORT: "5432"
64+
run: |
65+
python manage.py test --verbosity=2

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
.venv/
3+
.idea/
4+
.vscode/
5+
__pycache__/
6+
*.pyc
7+
8+
# Ignore the credentials (for obvious reasons)
9+
credentials.env
10+
videogames_register/migrations/__pycache__/
11+
Videogames_project/__pycache__/

.idea/Videogames_project.iml

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)