diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 0000000..d8edaa7 --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,42 @@ +name: Pylint + +on: + push: + paths: + - '**.py' + - '.github/workflows/**' + - 'requirements.txt' + branches: + - main + pull_request: + paths: + - '**.py' + - '.github/workflows/**' + - 'requirements.txt' + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.12"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install pip + run: | + python -m pip install --upgrade pip + - name: Install pylint + run: | + pip install pylint + - name: Install requirements + run: | + python -m pip install -r ./requirements.txt + - name: Analysing the code with pylint + run: | + pylint $(git ls-files 'ufpy/*.py') --fail-under=7.0 \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c9c19a0 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,38 @@ +name: Test with UnitTest + +on: + push: + paths: + - '**.py' + - '.github/workflows/**' + - 'requirements.txt' + branches: + - main + pull_request: + paths: + - '**.py' + - '.github/workflows/**' + - 'requirements.txt' + branches: + - main + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.12 + uses: actions/setup-python@v3 + with: + python-version: "3.12.1" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Test with UnitTest + run: | + python $(git ls-files 'tests/*.py') \ No newline at end of file diff --git a/.gitignore b/.gitignore index b32d943..b260254 100644 --- a/.gitignore +++ b/.gitignore @@ -159,8 +159,5 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. .idea/ -# Vscode -#.vscode - # Tests tests.py diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29