Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refact: CodeQL Analysis #7

Merged
merged 5 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
45 changes: 0 additions & 45 deletions .github/codeql-analysis.yml

This file was deleted.

69 changes: 69 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CodeQL Analysis

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '36 0 * * 3' # todas as quartas-feiras às 00:36 (meia-noite e 36 minutos) no fuso horário UTC.

jobs:
analyze:
name: CodeQL Analyze
runs-on: ubuntu-latest

permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
language: [ 'java-kotlin' ]
# Adicione outras linguagens se houver, como 'javascript', 'python', etc.
build-mode: [ none ]
# Adicione none ou manual dentro do array para cair em alguma execução abaixo.

steps:

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Check out the repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

- name: Build the code
if: matrix.build-mode == 'none'
run: |
# Comando para rodar o build da aplicação:
mvn clean install -DskipTests -U

- name: Manual Build Commands
if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'Executando o build manual para análise do CodeQL'
# Comandos específicos para build manual:
mvn clean install -DskipTests -U

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"