ImHex/.github/workflows/analysis.yml

62 lines
1.3 KiB
YAML
Raw Normal View History

2021-09-11 16:15:27 +00:00
name: "CodeQL and Unit Tests"
2021-08-29 12:26:50 +00:00
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '21 0 * * 2'
jobs:
analyze:
name: 🐛 Analyze
2021-08-29 12:26:50 +00:00
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: 🧰 Checkout
2021-08-29 12:26:50 +00:00
uses: actions/checkout@v2
2021-08-29 12:40:10 +00:00
with:
fetch-depth: 0
submodules: recursive
2021-08-29 12:26:50 +00:00
- name: ✋ Initialize CodeQL
2021-08-29 12:26:50 +00:00
uses: github/codeql-action/init@v1
with:
languages: 'cpp'
2021-08-29 12:26:50 +00:00
2021-09-19 19:49:09 +00:00
- name: 📜 Restore cache
uses: actions/cache@v2
with:
path: |
~/.ccache
.flatpak-builder
key: ${{ runner.os }}-build
- 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 build
cd build
CC=gcc-10 CXX=g++-10 cmake \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
2021-09-19 19:49:09 +00:00
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
2021-08-29 12:30:40 +00:00
..
make -j 4 install
2021-08-29 12:26:50 +00:00
- name: 🧪 Perform Unit Tests
run: |
cd build
ctest
- name: 🗯️ Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1