-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from soda480/0.3.1
0.3.1
- Loading branch information
Showing
7 changed files
with
73 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,56 @@ | ||
name: build | ||
on: | ||
schedule: | ||
- cron: "0 8 * * *" | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
build-images: | ||
strategy: | ||
matrix: | ||
version: ['3.7', '3.8', '3.9', '3.10'] | ||
name: Build Python Docker images | ||
runs-on: ubuntu-20.04 | ||
container: python:3.9-slim | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install pybuilder | ||
run: pip install pybuilder | ||
|
||
- name: Execute build | ||
run: pyb | ||
|
||
- name: Install Codecov requirements | ||
run: | | ||
apt-get update | ||
apt-get install -y bash curl | ||
sed -e 's,filename="pybuilder-radon/,filename="src/main/python/pybuilder_radon/,g' target/reports/pybuilder-radon_coverage.xml > coverage.xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: coverage.xml | ||
- uses: actions/checkout@v3 | ||
- name: build pybradon ${{ matrix.version }} image | ||
run: | ||
docker image build --build-arg PYTHON_VERSION=${{ matrix.version }} -t pybradon:${{ matrix.version }} . | ||
- name: save pybradon ${{ matrix.version }} image | ||
if: ${{ matrix.version == '3.9' }} | ||
run: | | ||
mkdir -p images | ||
docker save --output images/pybradon-${{ matrix.version }}.tar pybradon:${{ matrix.version }} | ||
- name: upload pybradon ${{ matrix.version }} image artifact | ||
if: ${{ matrix.version == '3.9' }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: image | ||
path: images/pybradon-${{ matrix.version }}.tar | ||
coverage: | ||
name: Publish Code Coverage Report | ||
needs: build-images | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: download image artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: image | ||
path: images/ | ||
- name: load image | ||
run: | ||
docker load --input images/pybradon-3.9.tar | ||
- name: prepare report | ||
run: | | ||
ID=$(docker create pybradon:3.9) | ||
docker cp $ID:/code/target/reports/pybuilder-radon_coverage.xml pybradon_coverage.xml | ||
sed -i -e 's,filename="pybradon/,filename="src/main/python/pybradon/,g' pybradon_coverage.xml | ||
- name: upload report | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: pybradon_coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
FROM python:3.9-slim | ||
ARG PYTHON_VERSION=3.9 | ||
FROM python:${PYTHON_VERSION}-slim | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
WORKDIR /code | ||
COPY . /code/ | ||
RUN pip install pybuilder | ||
RUN pyb | ||
RUN pip install --upgrade pip && pip install pybuilder | ||
RUN pyb -X |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,16 +11,20 @@ | |
use_plugin('python.flake8') | ||
use_plugin('python.coverage') | ||
use_plugin('python.distutils') | ||
|
||
use_plugin('pypi:pybuilder_bandit') | ||
use_plugin('pypi:pybuilder_anybadge') | ||
|
||
name = 'pybuilder-radon' | ||
authors = [Author('Emilio Reyes', '[email protected]')] | ||
summary = 'Pybuilder plugin for radon cyclomatic complexity' | ||
url = 'https://github.com/soda480/pybuilder-radon' | ||
version = '0.3.0' | ||
version = '0.3.1' | ||
default_task = [ | ||
'clean', | ||
'publish' | ||
'analyze', | ||
'publish', | ||
'bandit', | ||
'anybadge' | ||
] | ||
license = 'Apache License, Version 2.0' | ||
description = summary | ||
|
@@ -36,7 +40,7 @@ def set_properties(project): | |
project.set_property('flake8_include_scripts', True) | ||
project.set_property('flake8_include_test_sources', True) | ||
project.set_property('flake8_ignore', 'F401, E501') | ||
project.build_depends_on_requirements('requirements-build.txt') | ||
project.build_depends_on('mock') | ||
project.depends_on_requirements('requirements.txt') | ||
project.set_property('distutils_readme_description', True) | ||
project.set_property('distutils_description_overwrite', True) | ||
|
@@ -50,11 +54,12 @@ def set_properties(project): | |
'License :: OSI Approved :: Apache Software License', | ||
'Operating System :: POSIX :: Linux', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Topic :: Software Development :: Build Tools']) | ||
project.set_property('anybadge_exclude', 'vulnerabilities, coverage') | ||
# only for functional testing plugin | ||
# project.set_property('radon_break_build_average_complexity_threshold', 2.74) | ||
# project.set_property('radon_break_build_complexity_threshold', 4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
versions=( '3.7' '3.8' '3.9' '3.10' ) | ||
for version in "${versions[@]}"; | ||
do | ||
docker image build --build-arg PYTHON_VERSION=$version -t pybradon:$version . | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["pybuilder>=0.12.0"] | ||
build-backend = "pybuilder.pep517" |
This file was deleted.
Oops, something went wrong.