Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
30a27e2
Testes inciais de CI
Guilherme2041 May 17, 2023
c446416
teste 1
Guilherme2041 May 17, 2023
3fd2af5
Merge pull request #1 from GONunes/joaoguilherme
Guilherme2041 May 17, 2023
7f341ea
Delete .github /workflows directory
Guilherme2041 May 17, 2023
8daeeed
Create CI.yml
Guilherme2041 May 17, 2023
9000b86
Create CD.yml
GONunes May 17, 2023
cf543ff
Update App.js
Guilherme2041 May 17, 2023
f4bafb9
Update CD.yml
GONunes May 17, 2023
94bde08
Update App.js teste 4
yurigadelha1 May 17, 2023
4337823
Update CD.yml
GONunes May 17, 2023
096d495
Create sonar-project.propertiesnote
victoremannueluna May 17, 2023
facfb4e
Merge pull request #3 from GONunes/victoremannuel
victoremannueluna May 17, 2023
de3b9ed
Update App.js
LyndainesSantos May 17, 2023
a5eaaa2
Merge branch 'main' into yurigadelha
Guilherme2041 May 17, 2023
873d10d
Create sonar-project.properties
Guilherme2041 May 17, 2023
0d74121
Delete sonar-project.propertiesnote
Guilherme2041 May 17, 2023
dfb9899
Merge pull request #5 from GONunes/guilhermenunes
GONunes May 17, 2023
ac61dd5
Create CD.yml
Guilherme2041 May 17, 2023
a06cc34
Delete .github /workflows directory
Guilherme2041 May 17, 2023
162ffdb
Update sonar-project.properties
Guilherme2041 May 17, 2023
ad48ca9
Merge pull request #4 from GONunes/yurigadelha
Guilherme2041 May 17, 2023
d8a75bc
Merge pull request #2 from GONunes/joaoguilherme
Guilherme2041 May 17, 2023
788d996
Update App.js
Guilherme2041 May 17, 2023
3dccd22
Update CD.yml
Guilherme2041 May 17, 2023
f81adb2
Merge pull request #6 from GONunes/joaoguilherme
Guilherme2041 May 17, 2023
b2881e7
Merge branch 'main' into lyndaines
Guilherme2041 May 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CD

on:
push:
branches: [ "main" ]

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

jobs:
CD:
runs-on: ubuntu-latest

steps:

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


- name: Set up Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x


- name: Install dependencies
run: npm install


- name: Run the tests
run: npm run test -- --coverage
env:
CI: true

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Build the application
run: npm run build

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'build'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
40 changes: 40 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Nome do fluxo
name: CI

# Aciona o fluxo quando:
on:
# Houver um pull
pull_request:
branches: [ "main" ]
# Permite a execução manual
workflow_dispatch:

# Fluxo de trabalho
jobs:
CI:
runs-on: ubuntu-latest

# Passos do fluxo de trabalho
steps:

- name: Checkout do repositório
uses: actions/checkout@v3

- name: Preparando Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Instalando dependências
run: npm install

- name: Executando testes
run: npm run test -- --coverage
env:
CI: true

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
9 changes: 9 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sonar.organization=guilherme-nunes
sonar.projectKey=GONunes_pre-hackathon-devops
sonar.sources=.
sonar.language=js,jsx,ts,tsx
sonar.javascript.file.suffixes=.js,.jsx
sonar.typescript.file.suffixes=.ts,.tsx
sonar.sourceEncoding=UTF-8
sonar.javascript.lcov.reportPaths=./coverage/lcov.info
sonar.exclusions=**/*.test.*
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function App() {
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
DevOps Básico IT Talent - Mudanças aula 26-04-2023
DevOps Básico IT Talent - Mudanças hackathon 17-05-2023 teste 3
</p>
<a
className="App-link"
Expand Down