diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml new file mode 100644 index 0000000..b2ffdc1 --- /dev/null +++ b/.github/workflows/black.yml @@ -0,0 +1,35 @@ +name: Black +on: [push] +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.11] + + steps: + # git checkout + - uses: actions/checkout@v4 + + # python setup + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + # python cache + - uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + # install black + - name: install black + run: pip install black + + # run black + - name: run black + run: black src/ --check --diff \ No newline at end of file diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml new file mode 100644 index 0000000..8f8096d --- /dev/null +++ b/.github/workflows/flake8.yml @@ -0,0 +1,35 @@ +name: Flake8 +on: [push] +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.8] + + steps: + # git checkout + - uses: actions/checkout@v2 + + # python setup + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + + # python cache + - uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + # install flake8 + - name: install flake8 + run: pip install flake8 + + # run black + - name: run flake8 + run: flake8 src/ setup.py \ No newline at end of file diff --git a/.github/workflows/plone-package.yml b/.github/workflows/plone-package.yml deleted file mode 100644 index 9cc2434..0000000 --- a/.github/workflows/plone-package.yml +++ /dev/null @@ -1,65 +0,0 @@ -# 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: Plone package - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - plone-version: - - 'Plone52' - - 'Plone60' - python-version: [3.7, 3.8, 3.9] - - steps: - - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cache/pip - ~/buildout-cache - ~/extends - key: ${{ runner.os }}-tox-${{ matrix.python-version }}-${{ matrix.plone-version }}-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/*.cfg') }}-${{ hashFiles('**/constraints.txt') }}-${{ hashFiles('**/tox.ini') }} - #restore-keys: | - # ${{ runner.os }}-tox- - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: setup buildout cache - run: | - mkdir -p ~/buildout-cache/{eggs,downloads} - mkdir ~/.buildout - echo "[buildout]" > $HOME/.buildout/default.cfg - echo "download-cache = $HOME/buildout-cache/downloads" >> $HOME/.buildout/default.cfg - echo "eggs-directory = $HOME/buildout-cache/eggs" >> $HOME/.buildout/default.cfg - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox tox-gh-actions - - name: Black-Check - run: | - tox -r -e black-check - - name: Test with tox - run: | - tox -r - env: - PLONE-VERSION: ${{ matrix.plone-version }} - PYTHON-VERSION: ${{ matrix.python-version }} - - name: "Upload coverage to Codecov" - uses: "codecov/codecov-action@v3" - with: - fail_ci_if_error: true - if: matrix.python-version == '3.7' diff --git a/.github/workflows/pyroma.yml b/.github/workflows/pyroma.yml new file mode 100644 index 0000000..eb02621 --- /dev/null +++ b/.github/workflows/pyroma.yml @@ -0,0 +1,35 @@ +name: Pyroma +on: [push] +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.8] + + steps: + # git checkout + - uses: actions/checkout@v2 + + # python setup + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + + # python cache + - uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + # install pyroma + - name: install pyroma + run: pip install pyroma + + # run pyroma + - name: run pyroma + run: pyroma -n 10 -d . \ No newline at end of file diff --git a/.github/workflows/zpretty.yml b/.github/workflows/zpretty.yml new file mode 100644 index 0000000..23a03bb --- /dev/null +++ b/.github/workflows/zpretty.yml @@ -0,0 +1,40 @@ +name: zpretty +on: [push] +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.8] + + steps: + # git checkout + - uses: actions/checkout@v2 + + # python setup + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + + # python cache + - uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + # install zpretty + - name: install zpretty + run: pip install zpretty + + # run zpretty + - name: run zpretty + run: find src -name '*.zcml' | xargs zpretty -i + + # XXX: this doesn't work on gh actions (https://github.com/plone/plone.restapi/pull/1119/checks?check_run_id=2686474411) + # run git diff + - name: run git diff + run: git diff --exit-code \ No newline at end of file