dev #2
51
.github/workflows/ci.yml
vendored
51
.github/workflows/ci.yml
vendored
@@ -5,9 +5,54 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-lint:
|
linters:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: lint dockerfile
|
- name: Getting the codebase
|
||||||
run: echo hello
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: dev
|
||||||
|
- name: Lint the Dockerfile
|
||||||
|
uses: hadolint/hadolint-action@v3.1.0
|
||||||
|
with:
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
- name: Lint the source code
|
||||||
|
uses: Silleellie/pylint-github-action@v2.1
|
||||||
|
with:
|
||||||
|
lint-path: |
|
||||||
|
mysite
|
||||||
|
polls
|
||||||
|
manage.py
|
||||||
|
requirements-path: requirements.txt
|
||||||
|
readme-path: README.md
|
||||||
|
python-version: 3.11 # python version which will lint the package
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: "3.11"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pip install -r requirements.txt
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: pytest
|
||||||
|
|
||||||
|
- name: Notify in telegram about fail
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: appleboy/telegram-action@master
|
||||||
|
with:
|
||||||
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
|
message: |
|
||||||
|
${{ github.actor }} created commit:
|
||||||
|
Commit message: ${{ github.event.commits[0].message }}
|
||||||
|
Repository: ${{ github.repository }}
|
||||||
|
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
|
||||||
|
|
||||||
|
- name: Check fail
|
||||||
|
run: echo "Unreachable"
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,3 +4,4 @@ venv
|
|||||||
polls/__pycache__
|
polls/__pycache__
|
||||||
polls/migrations/__pycache__
|
polls/migrations/__pycache__
|
||||||
.env
|
.env
|
||||||
|
tests/__pycache__
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
FROM python:3.11-alpine
|
FROM python:3.11-alpine
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
COPY ./mysite ./mysite
|
COPY ./mysite ./mysite
|
||||||
COPY ./polls ./polls
|
COPY ./polls ./polls
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
# Django example app
|
# Django example app
|
||||||
|
|
||||||
Application made by django's instruction for **DevOps** education purposes
|
Application made by django's instruction for **DevOps** education purposes
|
||||||
|
|
||||||
|
# Pylint
|
||||||
|
|
||||||
|

|
||||||
|
|||||||
@@ -123,3 +123,6 @@ class QuestionDetailViewTests(TestCase):
|
|||||||
url = reverse("polls:detail", args=(past_question.id,))
|
url = reverse("polls:detail", args=(past_question.id,))
|
||||||
response = self.client.get(url)
|
response = self.client.get(url)
|
||||||
self.assertContains(response, past_question.question_text)
|
self.assertContains(response, past_question.question_text)
|
||||||
|
def test_fake_test(self):
|
||||||
|
self.assertEqual(0, 1)
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
asgiref==3.8.1
|
asgiref==3.8.1
|
||||||
Django==5.2.1
|
Django==5.2.1
|
||||||
django-debug-toolbar==5.2.0
|
django-debug-toolbar==5.2.0
|
||||||
|
iniconfig==2.1.0
|
||||||
|
packaging==25.0
|
||||||
pip==23.0.1
|
pip==23.0.1
|
||||||
|
pluggy==1.6.0
|
||||||
psycopg==3.2.9
|
psycopg==3.2.9
|
||||||
psycopg-binary==3.2.9
|
psycopg-binary==3.2.9
|
||||||
|
Pygments==2.19.1
|
||||||
|
pytest==8.4.0
|
||||||
setuptools==66.1.1
|
setuptools==66.1.1
|
||||||
sqlparse==0.5.3
|
sqlparse==0.5.3
|
||||||
typing_extensions==4.14.0
|
typing_extensions==4.14.0
|
||||||
|
|||||||
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
3
tests/test_fail.py
Normal file
3
tests/test_fail.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
def test_fail():
|
||||||
|
# Fixed
|
||||||
|
assert 1 == 1
|
||||||
2
tests/test_success.py
Normal file
2
tests/test_success.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
def test_success():
|
||||||
|
assert True
|
||||||
Reference in New Issue
Block a user