Skip to content

Commit

Permalink
[CHORE] fedora codeql yml conf
Browse files Browse the repository at this point in the history
  • Loading branch information
nots1dd committed Nov 19, 2024
1 parent f7b93c4 commit 55eccc7
Showing 1 changed file with 20 additions and 29 deletions.
49 changes: 20 additions & 29 deletions .github/workflows/codeql-fedora.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,42 @@
name: "CodeQL Analysis for Anvilock in Fedora"

name: CodeQL Analysis for Anvilock in Fedora
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
codeql:
runs-on: ubuntu-latest # GitHub Actions runner (Ubuntu, but we will use Fedora inside Docker)
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ "c" ]

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

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

- name: CodeQL Analysis in Fedora (Docker)
run: |
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace fedora:latest bash -c "
# Update and install necessary dependencies
dnf update -y &&
dnf install -y gcc make cmake wget curl git &&
# Install CodeQL CLI inside the container
wget https://github.com/github/codeql-action/releases/download/v2.6.0/codeql-linux64.tar.gz &&
tar -xzf codeql-linux64.tar.gz &&
export PATH=\$PWD/codeql-linux64/codeql:\$PATH &&
# Run the build script
cd .github/workflows/ &&
chmod +x build-fedora.sh &&
./build-fedora.sh &&
# Initialize and run CodeQL analysis
codeql database init --language=c --db-dir=codeql-database &&
codeql database analyze --db-dir=codeql-database --format=sarif-latest --output=codeql-results.sarif"
- name: Upload CodeQL results
uses: github/codeql-action/upload-results@v2
dnf update -y &&
dnf install -y gcc make cmake codeql &&
cd .github/workflows/ &&
chmod +x build-fedora.sh &&
./build-fedora.sh &&
cd /workspace &&
codeql database create cpp-db --language=cpp &&
codeql database analyze cpp-db --format=sarif-latest --output=cpp-analysis.sarif"
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
results-file: codeql-results.sarif

sarif_file: cpp-analysis.sarif

0 comments on commit 55eccc7

Please sign in to comment.