-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
257 additions
and
17 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
DJANGO_SETTINGS_MODULE="parlance.settings.development" | ||
|
||
PARLANCE_DEBUG=True | ||
PARLANCE_SECRET_KEY="devjnz9&&+zo3i!j3)z_c-7xl&ti&26x02vokwx#uqlulu(wl_1ujparlance" | ||
PARLANCE_DATABASE_URL="postgres://django@localhost:5432/parlance" | ||
DJANGO_DEBUG=True | ||
SECRET_KEY="devjnz9&&+zo3i!j3)z_c-7xl&ti&26x02vokwx#uqlulu(wl_1ujparlance" | ||
DATABASE_URL="postgres://django@localhost:5432/parlance" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
### Scope of changes | ||
|
||
Describe the problem you're trying to solve and the fix/solution that you've implemented in this PR. | ||
|
||
### Type of change | ||
|
||
- [ ] bug fix | ||
- [ ] new feature | ||
- [ ] documentation | ||
- [ ] other (describe) | ||
|
||
### Acceptance criteria | ||
|
||
Describe how reviewers can test this change to be sure that it works correctly. Add a checklist if possible. | ||
|
||
### Author checklist | ||
|
||
- [ ] I have manually tested the change and/or added automation in the form of unit tests or integration tests | ||
- [ ] I have updated the dependencies list | ||
- [ ] I have added new test fixtures as needed to support added tests | ||
- [ ] I have added or updated the documentation | ||
- [ ] Check this box if a reviewer can merge this pull request after approval (leave it unchecked if you want to do it yourself) | ||
|
||
### Reviewer(s) checklist | ||
|
||
- [ ] Any new user-facing content that has been added for this PR has been QA'ed to ensure correct grammar, spelling, and understandability. | ||
- [ ] To the best of my ability, I believe that this PR represents a good solution to the specified problem and that it should be merged into the main code base. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: "CodeQL" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: | ||
- main | ||
schedule: | ||
# At 14:16 on Fridays | ||
- cron: '16 14 * * 5' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: | ||
- javascript | ||
- python | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
with: | ||
category: "/language:${{matrix.language}}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Containers | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
# Parlance Image Build | ||
parlance: | ||
name: Parlance | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Environment | ||
id: vars | ||
run: | | ||
echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | ||
echo "revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
- name: Docker Metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
# list of Docker images to use as basenames for tags | ||
# this should be configured for each container built | ||
images: | | ||
rotationalio/parlance | ||
gcr.io/rotationalio-habanero/parlance | ||
tags: | | ||
type=semver,pattern={{raw}} | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=sha,prefix=,suffix=,format=short | ||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Setup Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} | ||
|
||
- name: Login to GCR | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: gcr.io | ||
username: _json_key | ||
password: ${{ secrets.GCR_SERVICE_ACCOUNT }} | ||
|
||
- name: Build and Push | ||
id: docker_build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | | ||
GIT_REVISION=${{ steps.vars.outputs.revision }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Tests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
name: Flake8 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12.x' | ||
|
||
- name: Install Flake8 | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install flake8 | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Lint Python Code | ||
run: flake8 . | ||
|
||
test: | ||
name: Django Tests | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:15 | ||
env: | ||
POSTGRES_USER: django | ||
POSTGRES_PASSWORD: supersecret | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
|
||
steps: | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12.x' | ||
|
||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Test Dependencies | ||
run: | | ||
pip install -U pip | ||
pip install factory_boy==3.3.1 pytest==8.3.3 pytest-cov==5.0.0 \ | ||
pytest-django==4.9.0 pytest-env==1.1.5 pytest-flakes==4.0.5 | ||
- name: Install Dependencies | ||
run: pip install -r requirements.txt | ||
|
||
- name: Execute Tests | ||
env: | ||
DJANGO_SETTINGS_MODULE: parlance.settings.testing | ||
PARLANCE_DATABASE_URL: postgres://django:[email protected]:5432/parlance_test | ||
PARLANCE_SECRET_KEY: supersecretsquirrel | ||
run: pytest |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[pytest] | ||
DJANGO_SETTINGS_MODULE = parlance.settings.testing | ||
addopts = --cov=. --flakes | ||
python_files = tests.py test_*.py *_tests.py | ||
norecursedirs = .git _build assets theme tmp | ||
|
||
env = | ||
SECRET_KEY=supersecretsquirrel | ||
|
||
filterwarnings = | ||
ignore::DeprecationWarning | ||
ignore::PendingDeprecationWarning | ||
ignore:No directory at.*:UserWarning | ||
|
||
flakes-ignore = | ||
__init__.py UnusedImport | ||
__init__.py ImportStarUsed | ||
test_*.py ImportStarUsed | ||
test_*.py ImportStarUsage | ||
parlance/settings/*.py ImportStarUsage | ||
parlance/settings/*.py ImportStarUsed | ||
parlance/urls.py ImportStarUsed | ||
parlance/urls.py ImportStarUsage |