Skip to content

Commit c53ec1f

Browse files
authored
Merge pull request #1 from WillSams/chore/setup-initial-changes
Add working frontend
2 parents b1e1e24 + 9dd4726 commit c53ec1f

File tree

178 files changed

+23990
-3808
lines changed

Some content is hidden

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

178 files changed

+23990
-3808
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ko_fi: samswebs

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/frontend"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
target-branch: main
9+
- package-ecosystem: pip
10+
directory: "/backend"
11+
schedule:
12+
interval: weekly
13+
open-pull-requests-limit: 10
14+
target-branch: main
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Enforce Branch Name Semantics
2+
on:
3+
pull_request:
4+
branches: ["main"]
5+
jobs:
6+
lint-branch-name:
7+
name: Lint Branch Name
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/github-script@v6
12+
with:
13+
result-encoding: string
14+
script: |
15+
const enforceSemantic = (branchName) => {
16+
const semanticFormat = /(feat\W|feature\/|fix\/|chore\/|refactor\/|dependabot\/|docs\/|ci\/|style\/|test\/)/
17+
if (!semanticFormat.test(currentBranch)) {
18+
core.setFailed(
19+
`Branch names in PRs should use semantic conventions, e.g. (feat, fix, chore, refactor). To fix. ` +
20+
`perform: git branch -m <new_branch_name> && git push origin -u <:<old_branch_name> <new_branch_name>` +
21+
`For more details, please review https://www.conventionalcommits.org/ and https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716`)
22+
}
23+
}
24+
const currentBranch = context.payload.pull_request.head.ref
25+
enforceSemantic(currentBranch)

.github/workflows/pr-validate.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Application unit tests
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
unit-test-backend:
12+
runs-on: ubuntu-latest
13+
env:
14+
SECRET_KEY: ${{ secrets.SECRET_KEY }}
15+
REFRESH_SECRET_KEY: ${{ secrets.REFRESH_SECRET_KEY }}
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python 3.8
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: "3.8"
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install flake8 pytest
26+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
27+
- name: Lint with flake8
28+
run: |
29+
# stop the build if there are Python syntax errors or undefined names
30+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics \
31+
--builtins=screen --per-file-ignore='specs/**/*:E9,F63,F7,F82'
32+
33+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
34+
flake8 . --count --show-source --exit-zero --max-complexity=10 \
35+
--max-line-length=96 --statistics --per-file-ignore='specs/**/*:E9,F63,F7,F82'
36+
- name: Run pytest tests
37+
run: |
38+
chmod +x ./backend/scripts/test-coverage.sh
39+
cd backend && ./scripts/test-coverage.sh
40+
41+
unit-test-frontend:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: Setup Node.js
47+
uses: actions/setup-node@v3
48+
with:
49+
node-version: '20.x'
50+
51+
- name: Test with Jest
52+
run: |
53+
cd frontend
54+
npm ci && npm run test:coverage
55+

0 commit comments

Comments
 (0)