Skip to content

new1

new1 #16

Workflow file for this run

name: "CodeQL"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
analyze:
name: Analyze
runs-on: ${{ matrix.language == 'swift' && 'macos-latest' || 'ubuntu-latest' }}
timeout-minutes: ${{ matrix.language == 'swift' && 120 || 360 }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'csharp', 'javascript-typescript' ]
dot-version: ['3.1.x']
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libssl-dev \
libssl1.1 \
libicu-dev \
ca-certificates \
openssl \
curl \
pkg-config \
zlib1g-dev
- name: Check OpenSSL installation
run: |
openssl version
ldconfig -p | grep libssl
- name: Set System.Globalization.Invariant to true
run: echo "DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1" >> $GITHUB_ENV
- name: Setup dotnet ${{ matrix.dot-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dot-version }}
- name: Display dotnet version
run: dotnet --version
- name: Locate libssl and Set LD_LIBRARY_PATH
run: |
LIBSSL_PATH=$(find /usr/lib /lib -name "libssl.so*" | head -n 1)
echo "LIBSSL_PATH=$LIBSSL_PATH"
if [ -z "$LIBSSL_PATH" ]; then
echo "libssl not found"
exit 1
fi
export LD_LIBRARY_PATH=$(dirname $LIBSSL_PATH):$LD_LIBRARY_PATH
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Run dotnet restore with verbose logging
run: dotnet restore --verbosity detailed
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Build the C# project
if: matrix.language == 'csharp'
run: |
dotnet restore
dotnet build --configuration Release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"