From ce61da64bd8c783e5f9a5e796e74e7e1d131362e Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 14 Sep 2022 10:57:16 +0000 Subject: [PATCH] Updating GHES workflows --- ci/django.yml | 30 ++++++++++++++ ci/properties/django.properties.json | 6 +++ ci/properties/pylint.properties.json | 6 +++ ci/properties/python-app.properties.json | 6 +++ .../python-package-conda.properties.json | 6 +++ ci/properties/python-package.properties.json | 6 +++ ci/pylint.yml | 23 +++++++++++ ci/python-app.yml | 39 ++++++++++++++++++ ci/python-package-conda.yml | 34 ++++++++++++++++ ci/python-package.yml | 40 +++++++++++++++++++ icons/django.svg | 1 + icons/python.svg | 1 + 12 files changed, 198 insertions(+) create mode 100644 ci/django.yml create mode 100644 ci/properties/django.properties.json create mode 100644 ci/properties/pylint.properties.json create mode 100644 ci/properties/python-app.properties.json create mode 100644 ci/properties/python-package-conda.properties.json create mode 100644 ci/properties/python-package.properties.json create mode 100644 ci/pylint.yml create mode 100644 ci/python-app.yml create mode 100644 ci/python-package-conda.yml create mode 100644 ci/python-package.yml create mode 100644 icons/django.svg create mode 100644 icons/python.svg diff --git a/ci/django.yml b/ci/django.yml new file mode 100644 index 0000000..79550cc --- /dev/null +++ b/ci/django.yml @@ -0,0 +1,30 @@ +name: Django CI + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [3.7, 3.8, 3.9] + + 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 Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Run Tests + run: | + python manage.py test diff --git a/ci/properties/django.properties.json b/ci/properties/django.properties.json new file mode 100644 index 0000000..791fb21 --- /dev/null +++ b/ci/properties/django.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Django", + "description": "Build and Test a Django Project", + "iconName": "django", + "categories": ["Continuous integration", "Python", "Django"] +} diff --git a/ci/properties/pylint.properties.json b/ci/properties/pylint.properties.json new file mode 100644 index 0000000..23c15dc --- /dev/null +++ b/ci/properties/pylint.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Pylint", + "description": "Lint a Python application with pylint.", + "iconName": "python", + "categories": ["Continuous integration", "Python", "Bottle", "Flask"] +} diff --git a/ci/properties/python-app.properties.json b/ci/properties/python-app.properties.json new file mode 100644 index 0000000..1229b29 --- /dev/null +++ b/ci/properties/python-app.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Python application", + "description": "Create and test a Python application.", + "iconName": "python", + "categories": ["Continuous integration", "Python", "Bottle", "Flask"] +} diff --git a/ci/properties/python-package-conda.properties.json b/ci/properties/python-package-conda.properties.json new file mode 100644 index 0000000..5600766 --- /dev/null +++ b/ci/properties/python-package-conda.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Python Package using Anaconda", + "description": "Create and test a Python package on multiple Python versions using Anaconda for package management.", + "iconName": "python", + "categories": ["Continuous integration", "Python"] +} diff --git a/ci/properties/python-package.properties.json b/ci/properties/python-package.properties.json new file mode 100644 index 0000000..8c9dbcf --- /dev/null +++ b/ci/properties/python-package.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Python package", + "description": "Create and test a Python package on multiple Python versions.", + "iconName": "python", + "categories": ["Continuous integration", "Python", "Bottle", "Flask"] +} diff --git a/ci/pylint.yml b/ci/pylint.yml new file mode 100644 index 0000000..383e65c --- /dev/null +++ b/ci/pylint.yml @@ -0,0 +1,23 @@ +name: Pylint + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10"] + 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 dependencies + run: | + python -m pip install --upgrade pip + pip install pylint + - name: Analysing the code with pylint + run: | + pylint $(git ls-files '*.py') diff --git a/ci/python-app.yml b/ci/python-app.yml new file mode 100644 index 0000000..4b7fa5f --- /dev/null +++ b/ci/python-app.yml @@ -0,0 +1,39 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python application + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest diff --git a/ci/python-package-conda.yml b/ci/python-package-conda.yml new file mode 100644 index 0000000..57940bd --- /dev/null +++ b/ci/python-package-conda.yml @@ -0,0 +1,34 @@ +name: Python Package using Conda + +on: [push] + +jobs: + build-linux: + runs-on: ubuntu-latest + strategy: + max-parallel: 5 + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: 3.10 + - name: Add conda to system path + run: | + # $CONDA is an environment variable pointing to the root of the miniconda directory + echo $CONDA/bin >> $GITHUB_PATH + - name: Install dependencies + run: | + conda env update --file environment.yml --name base + - name: Lint with flake8 + run: | + conda install flake8 + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + conda install pytest + pytest diff --git a/ci/python-package.yml b/ci/python-package.yml new file mode 100644 index 0000000..583a366 --- /dev/null +++ b/ci/python-package.yml @@ -0,0 +1,40 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.8", "3.9", "3.10"] + + 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 dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest diff --git a/icons/django.svg b/icons/django.svg new file mode 100644 index 0000000..68cda56 --- /dev/null +++ b/icons/django.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/python.svg b/icons/python.svg new file mode 100644 index 0000000..8e2a35b --- /dev/null +++ b/icons/python.svg @@ -0,0 +1 @@ + \ No newline at end of file