Skip to content
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

Chore/create project skeleton #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ko_fi: samswebs
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/frontend"
schedule:
interval: weekly
open-pull-requests-limit: 10
target-branch: main
- package-ecosystem: pip
directory: "/backend"
schedule:
interval: weekly
open-pull-requests-limit: 10
target-branch: main
25 changes: 25 additions & 0 deletions .github/workflows/branch-name-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Enforce Branch Name Semantics
on:
pull_request:
branches: ["main"]
jobs:
lint-branch-name:
name: Lint Branch Name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/github-script@v6
with:
result-encoding: string
script: |
const enforceSemantic = (branchName) => {
const semanticFormat = /(feat\W|feature\/|fix\/|chore\/|refactor\/|dependabot\/|docs\/|style\/|test\/)/
if (!semanticFormat.test(currentBranch)) {
core.setFailed(
`Branch names in PRs should use semantic conventions, e.g. (feat, fix, chore, refactor). To fix. ` +
`perform: git branch -m <new_branch_name> && git push origin -u <:<old_branch_name> <new_branch_name>` +
`For more details, please review https://www.conventionalcommits.org/ and https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716`)
}
}
const currentBranch = context.payload.pull_request.head.ref
enforceSemantic(currentBranch)
Empty file.
Empty file.
57 changes: 57 additions & 0 deletions .github/workflows/pr-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Application unit tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
unit-test-backend:
runs-on: ubuntu-latest
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
REFRESH_SECRET_KEY: ${{ secrets.REFRESH_SECRET_KEY }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics \
--builtins=screen --per-file-ignore='specs/**/*:E9,F63,F7,F82'

# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --show-source --exit-zero --max-complexity=10 \
--max-line-length=96 --statistics --per-file-ignore='specs/**/*:E9,F63,F7,F82'
- name: Run pytest tests
run: |
chmod +x ./targets/backend/scripts/test-coverage.sh
cd targets/backend && ./scripts/test-coverage.sh

unit-test-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'

- name: Test with Jest
run: |
cd targets/client
npm ci && npm run test:coverage

Loading
Loading