ImHex/.github/workflows/analysis.yml

63 lines
1.6 KiB
YAML
Raw Normal View History

name: "CodeQL"
2021-08-29 12:26:50 +00:00
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
2021-08-29 12:26:50 +00:00
jobs:
codeql:
name: 🐛 CodeQL
runs-on: ubuntu-22.04
2021-08-29 12:26:50 +00:00
permissions:
actions: read
contents: read
security-events: write
steps:
- name: 🧰 Checkout
uses: actions/checkout@v3
2021-08-29 12:40:10 +00:00
with:
submodules: recursive
2021-08-29 12:26:50 +00:00
- name: ✋ Initialize CodeQL
uses: github/codeql-action/init@v2
2021-08-29 12:26:50 +00:00
with:
languages: 'cpp'
2021-08-29 12:26:50 +00:00
- name: 📜 Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
2021-09-19 19:49:09 +00:00
with:
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build
max-size: 50M
- name: 📜 Restore CMakeCache
uses: actions/cache@v3
with:
path: |
build/CMakeCache.txt
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
- name: ⬇️ Install dependencies
2021-08-29 12:30:40 +00:00
run: |
sudo apt update
sudo bash dist/get_deps_debian.sh
2021-09-11 16:15:27 +00:00
- name: 🛠️ Build
2021-08-29 12:30:40 +00:00
run: |
mkdir -p build
2021-08-29 12:30:40 +00:00
cd build
CC=gcc-12 CXX=g++-12 cmake \
2022-01-13 20:31:01 +00:00
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
2021-08-29 12:30:40 +00:00
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
2022-01-13 20:31:01 +00:00
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
-DIMHEX_PATTERNS_PULL_MASTER=ON \
2021-08-29 12:30:40 +00:00
..
make -j 4 install
2021-08-29 12:26:50 +00:00
- name: 🗯️ Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2