Skip to content

Commit

Permalink
Merge pull request #51 from ThiagoPanini/feature/repo-ci-config
Browse files Browse the repository at this point in the history
pr(dev): Aprimoramento esteira CI com novos workflows e steps
  • Loading branch information
ThiagoPanini authored Feb 1, 2023
2 parents a0e8de0 + 739aa47 commit a1b9d91
Show file tree
Hide file tree
Showing 6 changed files with 272 additions and 7 deletions.
Empty file removed .github/codecov.yml
Empty file.
67 changes: 67 additions & 0 deletions .github/configs/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'

exclude-labels:
- github-bot 🤖

categories:
- title: 🛠️ Breaking Changes
labels:
- breaking-change 🛠️

- title: 🚀 Features
labels:
- feature 🚀
- enhancement 🍀

- title: 🐞 Bug Fixes
labels:
- bug 🐞

- title: 💻 Application
labels:
- app 💻

- title: 🧱 Infrastructure
labels:
- infra 🧱

- title: 🛡️ Tests
labels:
- tests 🛡️

- title: ⚙️ Configuration and Maintenance
- config ⚙️

- title: 🖍️ Documentation
labels:
- doc 🖍️

- title: Other Changes
labels:
- "*"

change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&'

version-resolver:
major:
labels:
- breaking-change 🛠️
minor:
labels:
- feature 🚀
- enhancement 🍀
patch:
labels:
- app 💻
- infra 🧱
- tests 🛡️
- bug 🐞
- doc 🖍️
- observability 👁️‍🗨️

default: patch

template: |
## Changes
25 changes: 25 additions & 0 deletions .github/workflows/ci-release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 📦 Release Drafter

on:
push:
branches:
- main

permissions:
contents: read

jobs:
update-release-draft:
name: "update-relase-draft"
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Cria novo draft de release
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config-name: configs/release-drafter.yml
89 changes: 89 additions & 0 deletions .github/workflows/ci-terraglue-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: ⚙️ CI terraglue - develop

on:
push:
branches:
- develop

permissions:
id-token: write
contents: read
pull-requests: write

jobs:
ci-python:
name: ci-python
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Instalação do Python
uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: Instalação das Dependências
run: |
python -m pip install --upgrade pip
python -m pip install -r ./app/requirements-ci.txt
- name: Análise de Linter - flake8
run:
flake8 . --ignore E501

- name: Análise de Docstrings - pydocstyle
run:
pydocstyle --match-dir ./app/src/*.py

ci-terraform:
name: ci-terraform
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Configuração de Credenciais AWS
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_OIDC_ROLE }}
role-session-name: OIDCSession
aws-region: sa-east-1

- name: Configuração e Setup do Terraform
uses: hashicorp/setup-terraform@v2

- name: terraform init
run: |
cd infra/
terraform init
- name: terraform plan
run: |
cd infra/
terraform plan
continue-on-error: false

open-pr-to-main:
name: open-pr-to-main
runs-on: ubuntu-latest
needs:
- ci-python
- ci-terraform

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cria PR para main
uses: repo-sync/pull-request@v2
with:
source_branch: ${{ github.ref }}
destination_branch: "main"
pr_title: "[PREENCHER] develop -> main"
pr_template: ".github/pull_request_template.md"
pr_assignee: "ThiagoPanini"
pr_label: github-bot 🤖
github_token: ${{ secrets.GITHUB_TOKEN }}
89 changes: 89 additions & 0 deletions .github/workflows/ci-terraglue-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: ⚙️ CI terraglue - feature branch

on:
push:
branches:
- feature**

permissions:
id-token: write
contents: read
pull-requests: write

jobs:
ci-python:
name: ci-python
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Instalação do Python
uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: Instalação das Dependências
run: |
python -m pip install --upgrade pip
python -m pip install -r ./app/requirements-ci.txt
- name: Análise de Linter - flake8
run:
flake8 . --ignore E501

- name: Análise de Docstrings - pydocstyle
run:
pydocstyle --match-dir ./app/src/*.py

ci-terraform:
name: ci-terraform
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Configuração de Credenciais AWS
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_OIDC_ROLE }}
role-session-name: OIDCSession
aws-region: sa-east-1

- name: Configuração e Setup do Terraform
uses: hashicorp/setup-terraform@v2

- name: terraform init
run: |
cd infra/
terraform init
- name: terraform plan
run: |
cd infra/
terraform plan
continue-on-error: false

open-pr-to-dev:
name: open-pr-to-dev
runs-on: ubuntu-latest
needs:
- ci-python
- ci-terraform

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cria PR para dev
uses: repo-sync/pull-request@v2
with:
source_branch: ${{ github.ref }}
destination_branch: "develop"
pr_title: "[PREENCHER] ${{ github.ref }} -> develop"
pr_template: ".github/pull_request_template.md"
pr_assignee: "ThiagoPanini"
pr_label: github-bot 🤖
github_token: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
name: ⚙️ CI terraglue
name: ⚙️ CI terraglue - main

on:
push:
branches:
- develop
- feature**
pull_request:
branches:
- develop
- main

permissions:
Expand Down Expand Up @@ -109,4 +104,4 @@ jobs:
run: |
cd infra/
terraform plan
continue-on-error: false
continue-on-error: false

0 comments on commit a1b9d91

Please sign in to comment.