Skip to content

Commit

Permalink
chore: update GitHub workflows to integrate Sonar; refactor tests and…
Browse files Browse the repository at this point in the history
… security workflows
  • Loading branch information
rorteg committed Sep 4, 2024
1 parent 4f85225 commit aa28b60
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 39 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/coordinate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Coordinate Workflows
on:
push:
branches:
- production
- staging
pull_request:
types: [opened, synchronize, reopened]
jobs:
quality-assurance:
uses: ./.github/workflows/tests.yml
with:
coverage-path: coverage/lcov.info

information-security:
needs: quality-assurance
name: information-security
uses: ./.github/workflows/infosec.yml
with:
coverage-path: coverage/lcov.info
secrets: inherit
23 changes: 12 additions & 11 deletions .github/workflows/infosec.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Application security
name: Information Security Workflow

on:
push:
branches:
- production
- master
- main
pull_request:
types: [opened, synchronize, reopened]
workflow_call:
inputs:
coverage-path:
required: false
type: string

jobs:
scans:
uses: madeiramadeirabr/private_action-information-security-validators/.github/workflows/main.yml@production
secrets: inherit
application-security:
name: actions
uses: madeiramadeirabr/private_action-information-security-validators/.github/workflows/main.yml@development
with:
coverage-path: ${{ inputs.coverage-path }}
secrets: inherit
24 changes: 0 additions & 24 deletions .github/workflows/sonar.yml

This file was deleted.

25 changes: 21 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Run tests on pull_request

on:
pull_request:
branches:
- "production"
workflow_call:
inputs:
coverage-path:
required: false
type: string

jobs:
unit-tests:
Expand All @@ -24,4 +28,17 @@ jobs:
run: npm run build

- name: Run tests
run: npm run test:coverage
run: npm run test:coverage

- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: ${{ inputs.coverage-path }}

- name: Check test status
run: |
if [ ${{ job.status }} -ne 0 ]; then
echo "Tests failed. Can't merge."
exit 1
fi
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ Aberto para qualquer equipe atualizar e implementar funcionalidades
- [Documentação técnica](./docs/README.md)
- [Instalação](./docs/instalacao.md)
- [Como utilizar](./docs/uso.md)
- [Como usar o padrão de eventos MMRFC 5](./docs/standard-events.md)
- [Executando os testes](./docs/tests.md)

0 comments on commit aa28b60

Please sign in to comment.