-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9a563e3
Showing
300 changed files
with
49,012 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
# EditorConfig Configurtaion file, for more details see: | ||
# https://EditorConfig.org | ||
# EditorConfig is a convention description, that could be interpreted | ||
# by multiple editors to enforce common coding conventions for specific | ||
# file types | ||
|
||
# top-most EditorConfig file: | ||
# Will ignore other EditorConfig files in Home directory or upper tree level. | ||
root = true | ||
|
||
|
||
[*] # For All Files | ||
# Unix-style newlines with a newline ending every file | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
# Set default charset | ||
charset = utf-8 | ||
# Indent style default | ||
indent_style = space | ||
|
||
[*.{py,cfg,ini}] | ||
# 4 space indentation | ||
indent_size = 4 | ||
|
||
[*.{html,dtml,pt,zpt,xml,zcml,js,json,ts,less,css,sass,yml,yaml}] | ||
# 2 space indentation | ||
indent_size = 2 | ||
|
||
[{Makefile,.gitmodules}] | ||
# Tab indentation (no size specified, but view as 4 spaces) | ||
indent_style = tab | ||
indent_size = unset | ||
tab_width = unset |
Validating CODEOWNERS rules …
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 @@ | ||
/.github/ @ericof |
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,124 @@ | ||
name: 'PortalBrasil: Intranet - Backend CI' | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
env: | ||
IMAGE_NAME_PREFIX: ghcr.io/plonegovbr/portalbrasil-intranet | ||
IMAGE_NAME_SUFFIX: backend | ||
PYTHON_VERSION: "3.11" | ||
|
||
jobs: | ||
|
||
config: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
PLONE_VERSION: ${{ steps.vars.outputs.PLONE_VERSION }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set Env Vars | ||
id: vars | ||
run: | | ||
echo "PLONE_VERSION=$(cat backend/version.txt)" >> $GITHUB_OUTPUT | ||
code-quality: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- config | ||
steps: | ||
- name: Checkout codebase | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install hatch | ||
run: pipx install hatch | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
cache: 'pip' | ||
|
||
- name: "Install Environment" | ||
run: hatch env create | ||
|
||
- name: "Run checks" | ||
run: hatch run lint | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- config | ||
steps: | ||
- name: Checkout codebase | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install hatch | ||
run: pipx install hatch | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
cache: 'pip' | ||
|
||
- name: "Install Environment" | ||
run: hatch env create | ||
|
||
- name: "Test Codebase" | ||
run: hatch run test | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- config | ||
- code-quality | ||
- test | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
${{ env.IMAGE_NAME_PREFIX }}-${{ env.IMAGE_NAME_SUFFIX }} | ||
labels: | | ||
org.label-schema.docker.cmd=docker run -d -p 8080:8080 ${{ env.IMAGE_NAME_PREFIX }}-${{ env.IMAGE_NAME_SUFFIX }}:latest | ||
flavor: | ||
latest=false | ||
tags: | | ||
type=ref,event=branch | ||
type=sha | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
platforms: linux/amd64 | ||
context: backend | ||
file: backend/Dockerfile | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | | ||
PLONE_VERSION=${{ needs.config.outputs.PLONE_VERSION }} |
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,144 @@ | ||
name: 'PortalBrasil: Intranet - Frontend CI' | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
env: | ||
IMAGE_NAME_PREFIX: ghcr.io/plonegovbr/portalbrasil-intranet | ||
IMAGE_NAME_SUFFIX: frontend | ||
NODE_VERSION: 20.x | ||
|
||
defaults: | ||
run: | ||
working-directory: ./frontend | ||
|
||
jobs: | ||
config: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
BASE_TAG: ${{ steps.vars.outputs.BASE_TAG }} | ||
VOLTO_VERSION: ${{ steps.vars.outputs.VOLTO_VERSION }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Compute several vars needed for the build | ||
id: vars | ||
run: | | ||
echo 'BASE_TAG=sha-$(git rev-parse --short HEAD)' >> $GITHUB_OUTPUT | ||
python3 -c 'import json; data = json.load(open("./mrs.developer.json")); print("VOLTO_VERSION=" + data["core"].get("tag") or "latest")' >> $GITHUB_OUTPUT | ||
- name: Test vars | ||
run: | | ||
echo 'BASE_TAG=${{ steps.vars.outputs.BASE_TAG }}' | ||
echo 'VOLTO_VERSION=${{ steps.vars.outputs.VOLTO_VERSION }}' | ||
code-analysis: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- config | ||
steps: | ||
- name: Checkout codebase | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js ${{ env.NODE_VERSION }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Enable corepack | ||
run: corepack enable | ||
|
||
- name: Get pnpm store directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: make install | ||
|
||
- name: Linting | ||
id: lint | ||
if: ${{ success() || failure() }} | ||
run: make lint | ||
|
||
- name: i18n sync | ||
id: i18n | ||
if: ${{ success() || failure() }} | ||
run: make ci-i18n | ||
|
||
- name: Unit Tests | ||
id: unit | ||
if: ${{ success() || failure() }} | ||
run: make test | ||
|
||
- name: Report | ||
if: ${{ success() || failure() }} | ||
run: | | ||
echo '# Code Analysis' >> $GITHUB_STEP_SUMMARY | ||
echo '| Test | Status |' >> $GITHUB_STEP_SUMMARY | ||
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY | ||
echo '| Lint | ${{ steps.lint.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY | ||
echo '| i18n | ${{ steps.i18n.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY | ||
echo '| Unit Tests | ${{ steps.unit.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- config | ||
- code-analysis | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
${{ env.IMAGE_NAME_PREFIX }}-${{ env.IMAGE_NAME_SUFFIX }} | ||
labels: | | ||
org.label-schema.docker.cmd=docker run -d -p 3000:3000 ${{ env.IMAGE_NAME_PREFIX }}-${{ env.IMAGE_NAME_SUFFIX }}:latest | ||
flavor: | ||
latest=false | ||
tags: | | ||
type=ref,event=branch | ||
type=sha | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
platforms: linux/amd64 | ||
context: frontend/ | ||
file: frontend/Dockerfile | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | | ||
VOLTO_VERSION=${{ needs.config.outputs.VOLTO_VERSION }} |
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,49 @@ | ||
name: 'PortalBrasil: Intranet - CI' | ||
|
||
on: | ||
push: | ||
paths: | ||
- "backend/**" | ||
- "frontend/**" | ||
- ".github/workflows/backend.yml" | ||
- ".github/workflows/frontend.yml" | ||
- ".github/workflows/main.yml" | ||
- "devops/**" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
config: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
backend: ${{ steps.filter.outputs.backend }} | ||
frontend: ${{ steps.filter.outputs.frontend }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
backend: | ||
- 'backend/**' | ||
- '.github/workflows/backend.yml' | ||
frontend: | ||
- 'frontend/**' | ||
- '.github/workflows/frontend.yml' | ||
backend: | ||
uses: ./.github/workflows/backend.yml | ||
needs: config | ||
if: ${{ needs.config.outputs.backend == 'true' }} | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
frontend: | ||
uses: ./.github/workflows/frontend.yml | ||
needs: config | ||
if: ${{ needs.config.outputs.frontend == 'true' }} | ||
permissions: | ||
contents: read | ||
packages: write |
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,4 @@ | ||
!.vscode | ||
node_modules | ||
/core | ||
/public |
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 @@ | ||
{ | ||
"eslint.workingDirectories": ["./frontend"], | ||
"flake8.cwd": "${workspaceFolder}/backend", | ||
"flake8.args": ["--config=pyproject.toml"] | ||
} |
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 @@ | ||
# Changes | ||
|
||
## 1.0.0 (2024-07-01) | ||
|
||
- Initial version [plonegovbr] |
Oops, something went wrong.