Skip to content

Commit 3837552

Browse files
committed
Initial commit
0 parents  commit 3837552

34 files changed

+1065
-0
lines changed

.dockerignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/__pycache__
2+
**/.classpath
3+
**/.dockerignore
4+
**/.env
5+
**/.git
6+
**/.gitignore
7+
**/.project
8+
**/.settings
9+
**/.toolstarget
10+
**/.vs
11+
**/.vscode
12+
**/*.*proj.user
13+
**/*.dbmdl
14+
**/*.jfm
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/compose*
19+
**/Dockerfile*
20+
**/node_modules
21+
**/npm-debug.log
22+
**/obj
23+
**/secrets.dev.yaml
24+
**/values.dev.yaml
25+
README.md

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/custom.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Custom issue template
3+
about: Describe this issue template's purpose here.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags:
7+
- "**"
8+
pull_request:
9+
branches: [main]
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
- name: Build the stack
18+
run: docker-compose up -d --build
19+
- name: Generate coverage report
20+
run: |
21+
docker exec -u 0 web bash -c "pytest --cov=./ --cov-report=xml" && docker exec web bash -c "echo $?"
22+
docker cp web:/workspace/coverage.xml .
23+
- name: Upload coverage to Codecov
24+
uses: codecov/codecov-action@v2
25+
with:
26+
token: ${{ secrets.CODECOV_TOKEN }}
27+
directory: ./coverage/reports/
28+
env_vars: OS,PYTHON
29+
fail_ci_if_error: true
30+
files: ./coverage.xml
31+
flags: unittests
32+
name: codecov-umbrella
33+
path_to_write_report: ./coverage/codecov_report.txt
34+
verbose: true
35+
- name: Upload coverage to Codacy
36+
run: |
37+
export CODACY_PROJECT_TOKEN=${{ secrets.CODACY_PROJECT_TOKEN }}
38+
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml
39+
build:
40+
needs: test
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v2
45+
- name: Docker meta
46+
id: docker_meta
47+
uses: crazy-max/ghaction-docker-meta@v1
48+
with:
49+
images: suy3024/fastapi-template
50+
tag-semver: |
51+
{{version}}
52+
{{major}}.{{minor}}
53+
- name: Set up Docker Buildx
54+
uses: docker/setup-buildx-action@v1
55+
- name: Login to DockerHub
56+
uses: docker/login-action@v1
57+
with:
58+
username: ${{ secrets.DOCKERHUB_USERNAME }}
59+
password: ${{ secrets.DOCKERHUB_TOKEN }}
60+
- name: Build and push
61+
uses: docker/build-push-action@v2
62+
with:
63+
context: .
64+
file: ./Dockerfile
65+
platforms: linux/amd64
66+
push: true
67+
tags: ${{ steps.docker_meta.outputs.tags }}
68+
labels: ${{ steps.docker_meta.outputs.labels }}

.github/workflows/codacy.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# This workflow checks out code, performs a Codacy security scan
7+
# and integrates the results with the
8+
# GitHub Advanced Security code scanning feature. For more information on
9+
# the Codacy security scan action usage and parameters, see
10+
# https://github.com/codacy/codacy-analysis-cli-action.
11+
# For more information on Codacy Analysis CLI in general, see
12+
# https://github.com/codacy/codacy-analysis-cli.
13+
14+
name: Codacy Security Scan
15+
16+
on:
17+
push:
18+
branches: [ main ]
19+
pull_request:
20+
# The branches below must be a subset of the branches above
21+
branches: [ main ]
22+
schedule:
23+
- cron: '21 20 * * 4'
24+
25+
permissions:
26+
contents: read
27+
28+
jobs:
29+
codacy-security-scan:
30+
permissions:
31+
contents: read # for actions/checkout to fetch code
32+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
33+
name: Codacy Security Scan
34+
runs-on: ubuntu-latest
35+
steps:
36+
# Checkout the repository to the GitHub Actions runner
37+
- name: Checkout code
38+
uses: actions/checkout@v3
39+
40+
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
41+
- name: Run Codacy Analysis CLI
42+
uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b
43+
with:
44+
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
45+
# You can also omit the token and run the tools that support default configurations
46+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
47+
verbose: true
48+
output: results.sarif
49+
format: sarif
50+
# Adjust severity of non-security issues
51+
gh-code-scanning-compat: true
52+
# Force 0 exit code to allow SARIF file generation
53+
# This will handover control about PR rejection to the GitHub side
54+
max-allowed-issues: 2147483647
55+
56+
# Upload the SARIF file generated in the previous step
57+
- name: Upload SARIF results file
58+
uses: github/codeql-action/upload-sarif@v2
59+
with:
60+
sarif_file: results.sarif

.github/workflows/codeql.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ main ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ main ]
20+
schedule:
21+
- cron: '29 4 * * 0'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'python' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v2
57+
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
60+
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
64+
65+
#- run: |
66+
# make bootstrap
67+
# make release
68+
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v2

0 commit comments

Comments
 (0)