From c3f9d272771e2beb69fc0ac96727f513db656a3f Mon Sep 17 00:00:00 2001 From: peppelinux Date: Thu, 13 May 2021 00:25:11 +0200 Subject: [PATCH 1/4] fix: CI - release-drafter also in master branch --- .github/release-drafter.yml | 54 ++++++++++++++++++++++++ .github/workflows/python-app.yml | 59 +++++++++++++++++++++++++++ .github/workflows/release-drafter.yml | 17 ++++++++ 3 files changed, 130 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/python-app.yml create mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..affd63bb --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,54 @@ +name-template: 'v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' +categories: +- + title: 'Features' + labels: + - 'enhancement' + - 'feat' + - 'feature' +- + title: 'Bug Fixes' + labels: + - 'bug' + - 'bugfix' + - 'fix' +- + title: 'Maintenance' + labels: + - 'chore' + - 'style' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. +version-resolver: + major: + labels: ['major'] + minor: + labels: ['minor'] + patch: + labels: ['patch'] + default: patch +exclude-labels: ['skip'] +autolabeler: +- + label: 'bug' + branch: + - '/bug\/.+/' + - '/bugfix\/.+/' + - '/fix\/.+/' +- + label: 'enhancement' + branch: + - '/dependabot\/.+/' + - '/enhancement\/.+/' + - '/feat\/.+/' + - '/feature\/.+/' +- + label: 'chore' + branch: + - '/chore\/.+/' + - '/style\/.+/' +template: | + ## Release notes + + $CHANGES diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 00000000..206bd562 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,59 @@ +# 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: oidc-op + +on: + push: + branches: [ master, develop ] + pull_request: + branches: [ master, develop ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + python-version: + - '3.7' + - '3.8' + - '3.9' + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + python setup.py install + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 src/oidcop --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 src/oidcop --max-line-length 120 --count --exit-zero --statistics + + - name: Test with pytest + run: | + pytest --cov=oidcop tests/ + - name: Bandit Security Scan + run: | + bandit --skip B105,B106,B107 -r src/oidcop/ + #- name: Upload coverage to Codecov + #uses: codecov/codecov-action@v1 + #with: + #token: ${{ secrets.CODECOV_TOKEN }} + #file: example/coverage.xml + #flags: unittests + #env_vars: OS,PYTHON + #name: codecov-umbrella + #fail_ci_if_error: true + #path_to_write_report: ./codecov_report.txt diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 00000000..af4a036a --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,17 @@ +name: Release drafter + +on: + push: + branches: [master, main, develop] + pull_request: + types: [opened, reopened, synchronize] + +jobs: + update_release_draft: + name: Update draft release + runs-on: ubuntu-latest + steps: + - + uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From f9fd4f7c8c98c707892151ec7f8040aee2ab0c12 Mon Sep 17 00:00:00 2001 From: peppelinux Date: Thu, 13 May 2021 00:30:40 +0200 Subject: [PATCH 2/4] added requirements-dev --- requirements-dev.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 requirements-dev.txt diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 00000000..36f34b11 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,7 @@ +pytest>=6.2.2 +pytest-black>=0.3.12 +pytest-cov>=2.11.1 +pytest-isort>=1.3.0 +pytest-localserver>=0.5.0 +flake8 +bandit From 86cfc83e1f3280f2070a3cdf62553ccf2810dae6 Mon Sep 17 00:00:00 2001 From: peppelinux Date: Thu, 13 May 2021 09:15:37 +0200 Subject: [PATCH 3/4] temporary deletion of gh actions --- .github/workflows/python-app.yml | 59 -------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml deleted file mode 100644 index 206bd562..00000000 --- a/.github/workflows/python-app.yml +++ /dev/null @@ -1,59 +0,0 @@ -# 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: oidc-op - -on: - push: - branches: [ master, develop ] - pull_request: - branches: [ master, develop ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - python-version: - - '3.7' - - '3.8' - - '3.9' - - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - python setup.py install - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 src/oidcop --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 src/oidcop --max-line-length 120 --count --exit-zero --statistics - - - name: Test with pytest - run: | - pytest --cov=oidcop tests/ - - name: Bandit Security Scan - run: | - bandit --skip B105,B106,B107 -r src/oidcop/ - #- name: Upload coverage to Codecov - #uses: codecov/codecov-action@v1 - #with: - #token: ${{ secrets.CODECOV_TOKEN }} - #file: example/coverage.xml - #flags: unittests - #env_vars: OS,PYTHON - #name: codecov-umbrella - #fail_ci_if_error: true - #path_to_write_report: ./codecov_report.txt From 9a25f0b59403a1767976228e671316e6ada32d92 Mon Sep 17 00:00:00 2001 From: peppelinux Date: Thu, 13 May 2021 09:17:20 +0200 Subject: [PATCH 4/4] fix: CI - release-drafter removed main branch --- .github/workflows/release-drafter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index af4a036a..ff418de0 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -2,7 +2,7 @@ name: Release drafter on: push: - branches: [master, main, develop] + branches: [master, develop] pull_request: types: [opened, reopened, synchronize]