CI/CD Pipelines¶
Used Stacks
GitHub Actions (Ruff, Setuptools, PyTest, Codecov) & Read the Docs (MkDocs)
Branch Rules¶
Dev Branch¶
Branch Rule
The dev branch is used when there are functional changes resulting in different build outcomes.
dev-*pushcheck-pr: Check if a PR is open for thedev-*branchbuild: Install dependencies & build packagelint: Format and lint Python code with Rufftest: Do PyTest
dev-*→mastercheck-commit: Commit message parsingbuild: Install dependencies & build packagelint: Format and lint Python code with Rufftest: Do PyTestdocs: Create PR (docs→dev-*) including the build results generated by Sphinxmerge-from-docs: If merge PR fromdocs, can mergedev-*→master
masterpushbuild: Install dependencies & build packagetest: Do PyTestdeployGitHub: Deploy to GitHubPyPI: Deploy to PyPI
Chore Branch¶
Branch Rule
The chore branch is utilized when the build result is not different, but there are changes in the CI/CD pipeline or documentation.
chore-*pushchore-*→mastercheck-commit: Commit message parsingbuild: Install dependencies & build packagelint: Format and lint Python code with Rufftest: Do PyTestdocs: Create PR (docs→dev-*) including the build results generated by Sphinxmerge-from-docs: If merge PR fromdocs, can mergedev-*→master
masterpushbuild: Install dependencies & build packagetest: Do PyTest
Managing Labels for Issues and Pull Requests in GitHub¶
- Issue
assignees: ['Zerohertz']contains(github.event.issue.title, '[Bug]')→labels: ['fix']contains(github.event.issue.title, '[Chore]')→labels: ['chore']contains(github.event.issue.title, '[Style]')→labels: ['style']contains(github.event.issue.title, '[Docs]')→labels: ['docs']
- Pull Request
assignees: ['Zerohertz']body.includes('bug') || body.includes('fix') || body.includes('수정')→labelsToAdd.push('fix')body.includes('style')→labelsToAdd.push('style')baseBranch === 'master' && headBranch.startsWith('dev')labelsToAdd.push('release')(file.filename.startsWith('Jenkins') || file.filename.startsWith('.github/workflows'))→labelsToAdd.push('chore')(file.filename.startsWith('sphinx') && !file.filename.includes('release'))→labelsToAdd.push('docs')(file.filename.startsWith('zerohertzLib/{MODULE_NAME}/__init__') || body.includes('{MODULE_NAME}'))→labelsToAdd.push('feat/{MODULE_NAME}')
baseBranch === 'master' && headBranch.startsWith('chore')labelsToAdd.push('release/chore')(file.filename.startsWith('Jenkins') || file.filename.startsWith('.github/workflows'))→labelsToAdd.push('chore')(file.filename.startsWith('sphinx') && !file.filename.includes('release'))→labelsToAdd.push('docs')
baseBranch.startsWith('dev') || baseBranch.startsWith('chore')) && headBranch === 'docs'labelsToAdd.push('docs')
MkDocs Documentation Deployment¶
MkDocs Documentation
Documents created and built using MkDocs are deployed via Read the Docs
Jenkins (Deprecated)
Used Stacks
Jenkins (Black, flake8, Pylint, Setuptools, PyTest, Sphinx)
Jenkins¶
| Stage | Condition |
|---|---|
1. Setup | ⭕ [* Push] |
2. Merge From Docs | ⭕ [* Push] "Merge pull request*/docs"⭕ [ * Push] "Merge pull request*[Docs] Build by Sphinx for GitHub Pages" |
3. 1. Lint | ⭕ [dev* Push]⭕ [ master PR] (Except "Merge pull request*/docs" && "Merge pull request*[Docs] Build by Sphinx for GitHub Pages") |
4. 2. Build | ⭕ [master Push] (Except "Merge pull request*/chore*")⭕ [ dev* Push]⭕ [ master PR] (Except "Merge pull request*/docs" && "Merge pull request*[Docs] Build by Sphinx for GitHub Pages") |
5. 3. Test | ⭕ [dev* Push]⭕ [ master PR] (Except "Merge pull request*/docs" && "Merge pull request*[Docs] Build by Sphinx for GitHub Pages") |
6. 4. Docs | ⭕ [master PR] (Except "Merge pull request*/docs" && "Merge pull request*[Docs] Build by Sphinx for GitHub Pages") |
7. Deploy | ⭕ [master Push] "Merge pull request*from Zerohertz/dev*" (Except "*from Zerohertz/chore*") |
Dev Branch¶
Branch Rule
The dev branch is used when there are functional changes resulting in different build outcomes.
dev-*pushSetup: Commit message parsing1. Lint: Check format of python codes2. Build: Install dependencies & build package3. Test: Do PyTest
dev-*→masterSetup: Commit message parsing1. Lint: Check format of python codes2. Build: Install dependencies & build package3. Test: Do PyTest4. Docs: Create PR (docs→dev-*) including the build results generated by SphinxMerge From Docs: If merge PR fromdocs, can mergedev-*→master
masterpushSetup: Commit message parsing2. Build: Install dependencies & build packageDeployGitHub: Deploy to GitHubPyPI: Deploy to PyPI
Chore Branch¶
Branch Rule
The chore branch is utilized when the build result is not different, but there are changes in the CI/CD pipeline or documentation.
chore-*pushSetup: Commit message parsing
chore-*→masterSetup: Commit message parsing1. Lint: Check format of python codes2. Build: Install dependencies & build package3. Test: Do PyTest4. Docs: Create PR (docs→chore-*) including the build results generated by SphinxMerge From Docs: If merge PR fromdocs, can mergechore-*→master
masterpushSetup: Commit message parsing





