Skip to content

Commit

Permalink
updated github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
daniele-andreotti committed Jul 1, 2024
1 parent 069f4d2 commit 17569ab
Show file tree
Hide file tree
Showing 6 changed files with 209 additions and 65 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -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
35 changes: 35 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -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
65 changes: 0 additions & 65 deletions .github/workflows/plone-package.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/pyroma.yml
Original file line number Diff line number Diff line change
@@ -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 .
64 changes: 64 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Tests
on:
push:
branches: ["main"]
pull_request:
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
config:
# [Python version, tox env]
# - ["2.7", "py27-plone52"]
# - ["3.7", "py37-plone52"]
- ["3.8", "py38-plone60"]
- ["3.9", "py39-plone60"]
- ["3.10", "py310-plone60"]
- ["3.11", "py311-plone60"]
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v3
with:
path: |
~/.cache/pip
eggs
.tox
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.config[0] }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test
run: tox -e ${{ matrix.config[1] }}
- name: Upload coverage data to coveralls.io
run: |
pip install coveralls
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.config[1] }}
COVERALLS_PARALLEL: true

coveralls_finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Finished
run: |
pip install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/zpretty.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 17569ab

Please sign in to comment.