Skip to content

Commit

Permalink
Setup CI to check code and run tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
caarmen committed Oct 23, 2023
1 parent ff1ba45 commit 0b3c283
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Code check
on:
pull_request:
push:
branches:
- main
jobs:
Check:
runs-on: ubuntu-latest
permissions:
checks: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
working-directory: ./flask
run: |
python -m pip install -r requirements/dev.txt --upgrade pip
- name: Run codecheck
working-directory: ./flask
run: bash scripts/code_check.sh
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
working-directory: ./flask
with:
report_paths: 'reports/junit.xml'
- name: Archive reports
if: always()
uses: actions/upload-artifact@v3
working-directory: ./flask
with:
name: reports
path: reports
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__pycache__/
.vscode/
reports/
2 changes: 1 addition & 1 deletion flask/scripts/code_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ do
black $project || error=$?
isort --profile black $project || error=$?
done
pytest || error=$?
pytest --junitxml="reports/junit.xml" || error=$?
exit $error

0 comments on commit 0b3c283

Please sign in to comment.