Skip to content

Commit

Permalink
Added basic CI
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinborner committed Aug 9, 2023
1 parent 2ffd235 commit c9136fb
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Format

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@master
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black pylint mypy
- run: bash ci.sh
7 changes: 7 additions & 0 deletions ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

set -e

black --diff --check $(git ls-files '*.py')
mypy --strict $(git ls-files '*.py')
pylint $(git ls-files '*.py')
7 changes: 6 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# SWR2 Cooles Projekt
# SWR2

## CI

To run the CI manually and not only on GitHub Actions, install `black`,
`pylint` and `mypy` using `pip`. Then, run `./ci.sh`.
11 changes: 11 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""main module for main things"""


def main() -> int:
"""main function for mainier things"""
print("hello world")
return 0


if __name__ == "__main__":
main()

0 comments on commit c9136fb

Please sign in to comment.