Skip to content

Commit

Permalink
Merge pull request #241 from GNS3/update-ga-workflows
Browse files Browse the repository at this point in the history
Update GitHub Action workflows
  • Loading branch information
grossmj authored May 17, 2024
2 parents c1ada0d + 915735a commit 804ae0c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 29 deletions.
73 changes: 48 additions & 25 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,57 +15,80 @@ on:
push:
branches: [ "master", "rust" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master", "rust" ]
schedule:
- cron: '36 0 * * 6'
- cron: '44 23 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
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
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

include:
- language: c-cpp
build-mode: manual
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

- run: |
echo "Install development libraries for libpcap and libelf"
sudo apt update && sudo apt install -qq -y --no-install-recommends libpcap-dev libelf-dev
- run: |
echo "Run, Build Application using script"
mkdir build
cd build
cmake ..
make
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo "Install development libraries for libpcap and libelf"
sudo apt update && sudo apt install -qq -y --no-install-recommends libpcap-dev libelf-dev
echo "Run, Build Application using script"
mkdir build
cd build
cmake ..
make
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
4 changes: 2 additions & 2 deletions .github/workflows/coverity-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
coverity_scan:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up environment
run: |
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
- name: Upload scan logs as artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: scan-logs
path: |
Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ install:
- 'appveyor DownloadFile http://ftp.slackware.com/pub/gsb/gsb64-2.30_slackware64-13.1/source/l/libelf/libelf-0.8.13.tar.gz'
- 'mkdir libelf && tar xvzf libelf-0.8.13.tar.gz -C libelf'
- '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER/libelf/libelf-0.8.13 && ./configure --host x86_64-pc-cygwin && make && make install'
- 'cinst 7zip.commandline'
- 'cinst winpcap'
- 'appveyor DownloadFile http://www.winpcap.org/install/bin/WpdPack_4_1_2.zip'
- 'dir'
- '7za x .\WpdPack_4_1_2.zip -o.'
- '7z x .\WpdPack_4_1_2.zip -o.'
- 'xcopy .\WpdPack\Lib\x64\*.* C:\cygwin64\lib\'
- 'xcopy /Y /E .\WpdPack\Include\*.* C:\cygwin64\usr\include\'

Expand Down

0 comments on commit 804ae0c

Please sign in to comment.