Skip to content

Commit cc82e6a

Browse files
committedMay 19, 2022
feat: initial setup of CICD and linting
1 parent 1f574ab commit cc82e6a

35 files changed

+2416
-700
lines changed
 

‎.circleci/config.yml

-37
This file was deleted.

‎.github/workflows/bump.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Bump version
2+
3+
on:
4+
workflow_run:
5+
workflows: [ "Lint" ]
6+
branches: [ master ]
7+
types:
8+
- completed
9+
10+
jobs:
11+
tag-version:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
token: ${{ secrets.PAT_TOKEN }}
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: 18
20+
- name: determine-version
21+
run: |
22+
VERSION=$(npx semantic-release --branches master --dry-run | { grep -i 'the next release version is' || test $? = 1; } | sed -E 's/.* ([[:digit:].]+)$/\1/')
23+
echo "VERSION=$VERSION" >> $GITHUB_ENV
24+
id: version
25+
- uses: rickstaa/action-create-tag@v1
26+
continue-on-error: true
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
29+
with:
30+
tag: v${{ env.VERSION }}
31+
message: "Releasing v${{ env.VERSION }}"
32+
github_token: ${{ secrets.PAT_TOKEN }}

‎.github/workflows/daily.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Daily check
2+
3+
on:
4+
schedule:
5+
- cron: '0 4 * * *'
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.7", "3.8", "3.9", "3.10"]
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v3
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- uses: docker-practice/actions-setup-docker@master
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
python -m pip install tox
25+
- name: Run tests
26+
run: |
27+
tox -e tests

‎.github/workflows/lint.yaml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
check-commits:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: webiny/action-conventional-commits@v1.0.3
15+
16+
check-linting:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python 3.10
21+
uses: actions/setup-python@v3
22+
with:
23+
python-version: "3.10"
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
python -m pip install tox
28+
- name: Check linting, formatting
29+
run: |
30+
tox -e check
31+
32+
check-docs:
33+
runs-on: ubuntu-latest
34+
needs:
35+
- check-commits
36+
- check-linting
37+
steps:
38+
- uses: actions/checkout@v3
39+
- name: Set up Python 3.10
40+
uses: actions/setup-python@v3
41+
with:
42+
python-version: "3.10"
43+
- name: Install dependencies
44+
run: |
45+
python -m pip install --upgrade pip
46+
python -m pip install tox
47+
- name: Check documentation build
48+
run: |
49+
tox -e docs
50+
51+
test:
52+
runs-on: ubuntu-latest
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
python-version: ["3.7", "3.8", "3.9", "3.10"]
57+
needs:
58+
- check-commits
59+
- check-linting
60+
steps:
61+
- uses: actions/checkout@v3
62+
- name: Set up Python ${{ matrix.python-version }}
63+
uses: actions/setup-python@v3
64+
with:
65+
python-version: ${{ matrix.python-version }}
66+
- uses: docker-practice/actions-setup-docker@master
67+
- name: Install dependencies
68+
run: |
69+
python -m pip install --upgrade pip
70+
python -m pip install tox
71+
- name: Run tests
72+
run: |
73+
tox -e tests
74+
75+
build:
76+
runs-on: ubuntu-latest
77+
needs: test
78+
steps:
79+
- uses: actions/checkout@v3
80+
- name: Set up Python 3.10
81+
uses: actions/setup-python@v3
82+
with:
83+
python-version: "3.10"
84+
- name: Install dependencies
85+
run: |
86+
python -m pip install --upgrade pip
87+
python -m pip install tox
88+
- name: Run build
89+
run: |
90+
tox -e build

‎.github/workflows/publish.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Python 3.10
14+
uses: actions/setup-python@v3
15+
with:
16+
python-version: "3.10"
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
python -m pip install tox wheel twine
21+
- name: Apply the tag version
22+
run: |
23+
version=${{ github.ref_name }}
24+
sed -i 's/__version__ = .*/__version__ = "'${version:1}'"/' keycloak/_version.py
25+
- name: Run build
26+
run: |
27+
tox -e build
28+
- name: Publish to PyPi
29+
env:
30+
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
31+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
32+
run: |
33+
twine upload -u $TWINE_USERNAME -p $TWINE_PASSWORD dist/*

‎.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,5 @@ ENV/
103103
.idea/
104104
main.py
105105
main2.py
106-
s3air-authz-config.json
106+
s3air-authz-config.json
107+
.vscode

‎.pre-commit-config.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v3.2.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- repo: https://github.com/compilerla/conventional-pre-commit
12+
rev: v1.2.0
13+
hooks:
14+
- id: conventional-pre-commit
15+
stages: [ commit-msg ]
16+
args: [ ] # optional: list of Conventional Commits types to allow

‎.readthedocs.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
3+
build:
4+
os: "ubuntu-20.04"
5+
tools:
6+
python: "3.10"
7+
8+
python:
9+
install:
10+
- requirements: docs-requirements.txt

‎.releaserc.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"plugins": ["@semantic-release/commit-analyzer"],
3+
"verifyConditions": false,
4+
"npmPublish": false,
5+
"publish": false,
6+
"fail": false,
7+
"success": false
8+
}

‎CHANGELOG.md

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,44 @@
1-
Changelog
2-
============
1+
# Changelog
32

43
All notable changes to this project will be documented in this file.
54

65
## [0.5.0] - 2017-08-21
76

8-
* Basic functions for Keycloak API (well_know, token, userinfo, logout, certs,
9-
entitlement, instropect)
7+
- Basic functions for Keycloak API (well_know, token, userinfo, logout, certs,
8+
entitlement, instropect)
109

1110
## [0.6.0] - 2017-08-23
1211

13-
* Added load authorization settings
12+
- Added load authorization settings
1413

1514
## [0.7.0] - 2017-08-23
1615

17-
* Added polices
16+
- Added polices
1817

1918
## [0.8.0] - 2017-08-23
2019

21-
* Added permissions
20+
- Added permissions
2221

2322
## [0.9.0] - 2017-09-05
2423

25-
* Added functions for Admin Keycloak API
24+
- Added functions for Admin Keycloak API
2625

2726
## [0.10.0] - 2017-10-23
2827

29-
* Updated libraries versions
30-
* Updated Docs
28+
- Updated libraries versions
29+
- Updated Docs
3130

3231
## [0.11.0] - 2017-12-12
3332

34-
* Changed Instropect RPT
33+
- Changed Instropect RPT
3534

3635
## [0.12.0] - 2018-01-25
3736

38-
* Add groups functions
39-
* Add Admin Tasks for user and client role management
40-
* Function to trigger user sync from provider
37+
- Add groups functions
38+
- Add Admin Tasks for user and client role management
39+
- Function to trigger user sync from provider
4140

4241
## [0.12.1] - 2018-08-04
4342

44-
* Add get_idps
45-
* Rework group functions
43+
- Add get_idps
44+
- Rework group functions

‎CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @ryshoooo @marcospereirampj

0 commit comments

Comments
 (0)
Please sign in to comment.