Skip to content

Commit bddcf4c

Browse files
authored
Merge pull request #17 from fga-eps-mds/v1.0
Finalização da primeira release e lançamento da primeira versão do CAPJu do semestre letivo 2023/1. Fechamento dos Épicos: E01 - Usabilidae (fga-eps-mds/2023-1-CAPJu-Doc#57) E03 - Unidade (fga-eps-mds/2023-1-CAPJu-Doc#69)
2 parents 9c3ccf9 + 5e84249 commit bddcf4c

File tree

102 files changed

+13736
-63
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+13736
-63
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
"arrow-body-style": "off",
2828
"import/prefer-default-export": "off",
2929
"react/react-in-jsx-scope": "off",
30+
"import/no-extraneous-dependencies": "off",
31+
"react/require-default-props": "off",
32+
"no-console": "off",
3033
"react/jsx-filename-extension": [
3134
1,
3235
{ "extensions": [".js", ".jsx", ".tsx", ".ts", ".d.ts"] }

.github/pull_request_template.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
1-
# Titulo
2-
<!-- Defina o título com o mesmo nome da Issue -->
1+
## Issue
2+
<!-- Descrever qual issue esse Pull Requeste deve fechar -->
33

4-
## Issue #
5-
<!-- Adicionar descrição breve sobre o que foi realizado>
6-
Closes #<numero da issue> <!-- Adicionar o numero da issue que será fechada com o merge da PR>
4+
Closes fga-eps-mds/2023-1-CAPJu-Doc#issue_number
75

86
## Descrição
9-
<!--- Descrição do problema solucionado -->
10-
<!-- Demostre que todos os criteiros de aceitacao foram solucionados-->
117

12-
## Screenshots (se apropriado):
13-
<!--- Forneça capturas de telas do problema solucionado caso seja necessário -->
14-
<!-- Forneca capturas de telas de antes e depois monstrando a mudança-->
8+
<!-- Descreve precisamente o que está sendo submetido e suas alterações -->
159

10+
## Revisão
11+
<!-- Verifica se os critérios estabelecidos na issue foram realizados -->
12+
- [] Critério 1
13+
- [] Critério 1
14+
- [] Critério 1
15+
16+
## Pre-merge checklist
17+
18+
- [] O Pull Request refere-se a um único assunto, um título claro e uma descrição em frases gramaticalmente corretas e completas.
19+
- [] A ramificação está atualizada com a branch Develop.
20+
- [] Os commits atendem o padrão especificado na política de contribuição.
21+
22+
23+
## Screenshots (Se necessário)
24+
25+
| Antes | Depois |
26+
| ----- | ------ |
27+
| Image 1 | Image 2 |

.github/workflows/.gitkeep

Whitespace-only changes.

.github/workflows/ci.yml

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
name: front-ci
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches:
8+
- main
9+
- develop
10+
types: [opened, synchronize, reopened]
11+
12+
jobs:
13+
format:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Use Node.js 16.x
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 16.x
23+
24+
- name: 📬 Caching
25+
uses: actions/cache@v3
26+
with:
27+
path: |
28+
${{ github.workspace }}/node_modules
29+
${{ github.workspace }}/dist
30+
key: ${{ runner.os }}-vite-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.{js,jsx,ts,tsx}') }}
31+
restore-keys: |
32+
${{ runner.os }}-vite-${{ hashFiles('**/yarn.lock') }}-
33+
34+
- name: 🧰 Instala bibliotecas e dependências
35+
run: npm i yarn -g && yarn
36+
37+
- name: 🔍 Verifica estilização do código
38+
run: yarn check-format
39+
40+
lint:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Checkout code
44+
uses: actions/checkout@v3
45+
46+
- name: Use Node.js 16.x
47+
uses: actions/setup-node@v3
48+
with:
49+
node-version: 16.x
50+
51+
- name: 📬 Caching
52+
uses: actions/cache@v3
53+
with:
54+
path: |
55+
${{ github.workspace }}/node_modules
56+
${{ github.workspace }}/dist
57+
key: ${{ runner.os }}-vite-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.{js,jsx,ts,tsx}') }}
58+
restore-keys: |
59+
${{ runner.os }}-vite-${{ hashFiles('**/yarn.lock') }}-
60+
61+
- name: 🧰 Instala bibliotecas e dependências
62+
run: npm i yarn -g && yarn
63+
64+
- name: 🧹 Verifica eslint
65+
run: yarn check-lint
66+
67+
type-check:
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Checkout code
71+
uses: actions/checkout@v3
72+
73+
- name: Use Node.js 16.x
74+
uses: actions/setup-node@v3
75+
with:
76+
node-version: 16.x
77+
78+
- name: 📬 Caching
79+
uses: actions/cache@v3
80+
with:
81+
path: |
82+
${{ github.workspace }}/node_modules
83+
${{ github.workspace }}/dist
84+
key: ${{ runner.os }}-vite-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.{js,jsx,ts,tsx}') }}
85+
restore-keys: |
86+
${{ runner.os }}-vite-${{ hashFiles('**/yarn.lock') }}-
87+
88+
- name: 🧰 Instala bibliotecas e dependências
89+
run: npm i yarn -g && yarn
90+
91+
- name: 🔧 Valida tipagens
92+
run: yarn check-types
93+
94+
test:
95+
runs-on: ubuntu-latest
96+
steps:
97+
- name: Checkout code
98+
uses: actions/checkout@v3
99+
100+
- name: Use Node.js 16.x
101+
uses: actions/setup-node@v3
102+
with:
103+
node-version: 16.x
104+
105+
- name: 📬 Caching
106+
uses: actions/cache@v3
107+
with:
108+
path: |
109+
${{ github.workspace }}/node_modules
110+
${{ github.workspace }}/dist
111+
key: ${{ runner.os }}-vite-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.{js,jsx,ts,tsx}') }}
112+
restore-keys: |
113+
${{ runner.os }}-vite-${{ hashFiles('**/yarn.lock') }}-
114+
115+
- name: 🧰 Instala bibliotecas e dependências
116+
run: npm i yarn -g && yarn
117+
118+
- name: 🧪 Roda suíte de testes
119+
run: yarn test
120+
121+
build:
122+
needs: [format, lint, type-check]
123+
runs-on: ubuntu-latest
124+
steps:
125+
- name: Checkout code
126+
uses: actions/checkout@v3
127+
128+
- name: Use Node.js 16.x
129+
uses: actions/setup-node@v3
130+
with:
131+
node-version: 16.x
132+
133+
- name: 📬 Caching
134+
uses: actions/cache@v3
135+
with:
136+
path: |
137+
${{ github.workspace }}/node_modules
138+
${{ github.workspace }}/dist
139+
key: ${{ runner.os }}-vite-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.{js,jsx,ts,tsx}') }}
140+
restore-keys: |
141+
${{ runner.os }}-vite-${{ hashFiles('**/yarn.lock') }}-
142+
143+
- name: 🧰 Instala bibliotecas e dependências
144+
run: npm i yarn -g && yarn
145+
146+
- name: 📦 Builda o projeto
147+
run: yarn build
148+
149+
sonarcloud:
150+
name: sonarcloud
151+
runs-on: ubuntu-latest
152+
continue-on-error: true
153+
steps:
154+
- name: Checkout code
155+
uses: actions/checkout@v3
156+
with:
157+
fetch-depth: 0
158+
159+
- name: 📬 Caching
160+
uses: actions/cache@v3
161+
with:
162+
path: |
163+
${{ github.workspace }}/node_modules
164+
${{ github.workspace }}/dist
165+
key: ${{ runner.os }}-vite-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.{js,jsx,ts,tsx}') }}
166+
restore-keys: |
167+
${{ runner.os }}-vite-${{ hashFiles('**/yarn.lock') }}-
168+
169+
- name: 🧰 Instala bibliotecas e dependências
170+
run: npm i -g yarn && yarn
171+
172+
- name: 📜 Relatório do eslint
173+
run: npx eslint -f json -o reports/eslint-report.json src || true
174+
175+
- name: 🧪 Testes e cobertura
176+
run: yarn test --coverage --passWithNoTests
177+
178+
- name: SonarCloud Scan
179+
uses: SonarSource/sonarcloud-github-action@master
180+
env:
181+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
182+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/release.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: front-release
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
tags:
7+
- "v*"
8+
9+
jobs:
10+
generate-release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: 'Get Previous tag'
17+
id: previoustag
18+
uses: "WyriHaximus/github-action-get-previous-tag@v1"
19+
with:
20+
fallback: 1.0.0
21+
22+
- name: Use Node.js 16.x
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: 16.x
26+
27+
- name: Cria métricas do SonarCloud
28+
run: python metrics/sonar-metrics.py ${{ github.event.repository.name }} ${{ github.ref_name }}
29+
30+
- name: Commita arquivos de métricas do SonarCloud
31+
run: |
32+
git config --global user.email "${{ secrets.GIT_EMAIL }}"
33+
git config --global user.name "${{ secrets.GIT_USER }}"
34+
git clone --single-branch --branch main "https://x-access-token:${{ secrets.PERSONAL_TOKEN }}@github.com/fga-eps-mds/2023-1-CAPJu-Doc" doc
35+
mkdir -p doc/analytics-raw-data
36+
cp -R fga-eps-mds*.json doc/analytics-raw-data
37+
cd doc
38+
git add .
39+
git commit -m "Métricas SonarCloud - ${{ github.event.repository.name }} ${{ github.ref_name }}"
40+
git push
41+
echo "Arquivos de métricas gerado com sucesso."

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ yarn-error.log*
77
pnpm-debug.log*
88
lerna-debug.log*
99

10+
coverage
1011
node_modules
1112
dist
1213
dist-ssr

.jsconfig.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

Makefile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
DOCKER_NAME=capju-front
2+
CURRENT_DIR=$(patsubst %/,%,$(dir $(realpath $(firstword $(MAKEFILE_LIST)))))
3+
#DIR_BASENAME=$(shell basename $(CURRENT_DIR))
4+
ROOT_DIR=$(CURRENT_DIR)
5+
PROJECT_DIR=src
6+
CURRENT_USER=sudo
7+
DOCKER_COMPOSE?=docker-compose
8+
DOCKER_COMPOSE_RUN=$(DOCKER_COMPOSE) run --rm
9+
DOCKER_EXEC_TOOLS_APP=$(CURRENT_USER) docker exec -it $(DOCKER_NAME) sh
10+
NODE_INSTALL="yarn"
11+
SERVER_RUN="yarn dev"
12+
13+
#
14+
# Exec containers
15+
#
16+
.PHONY: app
17+
18+
app:
19+
$(DOCKER_EXEC_TOOLS_APP)
20+
21+
#
22+
# Helpers
23+
#
24+
.PHONY: fix-permission
25+
26+
fix-permission:
27+
$(CURRENT_USER) chown -R ${USER}: $(ROOT_DIR)/
28+
29+
#
30+
# Commands
31+
#
32+
.PHONY: build install dev up start first stop restart clear
33+
34+
build:
35+
$(DOCKER_COMPOSE) up --build --no-recreate -d
36+
37+
install:
38+
$(DOCKER_EXEC_TOOLS_APP) -c $(NODE_INSTALL)
39+
40+
dev:
41+
$(DOCKER_EXEC_TOOLS_APP) -c $(SERVER_RUN)
42+
43+
up:
44+
$(DOCKER_COMPOSE) up -d
45+
46+
start: up dev
47+
48+
first: build install dev
49+
50+
stop: $(ROOT_DIR)/docker-compose.yml
51+
$(DOCKER_COMPOSE) kill || true
52+
$(DOCKER_COMPOSE) rm --force || true
53+
54+
restart: stop start dev
55+
56+
clear: stop $(ROOT_DIR)/docker-compose.yml
57+
$(DOCKER_COMPOSE) down -v --remove-orphans || true

0 commit comments

Comments
 (0)