Update codeql.yml #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CodeQL | ||
on: | ||
push: | ||
branches: [ master ] #check branch name | ||
pull_request: | ||
branches: [ master ] # check branch name | ||
schedule: | ||
- cron: '0 1 * * 3' | ||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'cpp', 'c' ] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GH_PAT }} #check the secret name | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y tcsh xfonts-base libssl-dev \ | ||
python-is-python3 \ | ||
python3-matplotlib python3-numpy \ | ||
python3-flask python3-flask-cors \ | ||
python3-pil \ | ||
gsl-bin netpbm gnome-tweaks \ | ||
libjpeg62 xvfb xterm vim curl \ | ||
gedit evince eog \ | ||
libglu1-mesa-dev libglw1-mesa-dev \ | ||
libxm4 build-essential \ | ||
libcurl4-openssl-dev libxml2-dev \ | ||
libgfortran-14-dev libgomp1 \ | ||
gnome-terminal nautilus \ | ||
firefox xfonts-100dpi \ | ||
r-base-dev cmake bc \ | ||
libgdal-dev libopenblas-dev \ | ||
libnode-dev libudunits2-dev | ||
pip install setuptools | ||
- name: Clean up disk space | ||
run: | | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /opt/ghc | ||
sudo rm -rf /usr/local/share/boost | ||
sudo apt-get clean | ||
- name: Download AFNI setup scripts | ||
run: | | ||
curl -O https://raw.githubusercontent.com/afni/afni/master/src/other_builds/OS_notes.linux_ubuntu_24_64_a_admin.txt | ||
curl -O https://raw.githubusercontent.com/afni/afni/master/src/other_builds/OS_notes.linux_ubuntu_24_64_b_user.tcsh | ||
curl -O https://raw.githubusercontent.com/afni/afni/master/src/other_builds/OS_notes.linux_ubuntu_24_64_c_nice.tcsh | ||
- name: Run AFNI admin setup script | ||
run: sudo bash OS_notes.linux_ubuntu_24_64_a_admin.txt 2>&1 | tee o.ubuntu_24_a.txt | ||
- name: Run AFNI user setup script | ||
run: tcsh OS_notes.linux_ubuntu_24_64_b_user.tcsh 2>&1 | tee o.ubuntu_24_b.txt | ||
- name: Niceify terminal | ||
run: tcsh OS_notes.linux_ubuntu_24_64_c_nice.tcsh 2>&1 | tee o.ubuntu_24_c.txt | ||
- name: Clone AFNI repository | ||
run: git clone https://github.com/YOUR_PRIVATE_REPO_URL.git #Check the repo url | ||
- name: Configure AFNI with CMake | ||
run: | | ||
export CC=$(which gcc) | ||
export CXX=$(which g++) | ||
mkdir -p afni/build | ||
cd afni/build | ||
cmake .. | ||
shell: /usr/bin/bash -e {0} | ||
env: | ||
pythonLocation: /opt/hostedtoolcache/Python/3.12.4/x64 | ||
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.4/x64/lib/pkgconfig | ||
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.4/x64 | ||
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.4/x64 | ||
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.4/x64 | ||
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.4/x64/lib | ||
- name: Build AFNI | ||
run: | | ||
cd afni/build | ||
make | ||
- name: Initialize the CodeQL toolchain | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: cpp,c | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v3 | ||
env: | ||
CC: ${{ env.CC }} | ||
CXX: ${{ env.CXX }} | ||
- name: Clean up disk space | ||
run: | | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /opt/ghc | ||
sudo rm -rf /usr/local/share/boost | ||
sudo apt-get clean | ||
sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
- name: Monitor disk space | ||
run: df -h | ||
- name: Monitor workspace usage | ||
run: du -sh /home/runner/work/afni/afni | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 |