mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
* Ci: added workflow_dispatch trigger * Ci: removed fetch depth * Ci: Add information to generated artifacts * Ci: Updated Linux runner to Ubuntu 22.04 * Packaging: Updated .deb dependencies * Ci: Removed ELF artifact * Ci: Upgraded actions versions * Ci: Switch to gcc-11 for unit tests and analysis
54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
name: "Unit Tests"
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
tests:
|
|
name: 🧪 Unit Tests
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
actions: read
|
|
contents: read
|
|
security-events: write
|
|
|
|
steps:
|
|
- name: 🧰 Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: 📜 Restore cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.ccache
|
|
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
|
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
|
|
|
- name: ⬇️ Install dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo bash dist/get_deps_debian.sh
|
|
|
|
- name: 🛠️ Build
|
|
run: |
|
|
mkdir -p build
|
|
cd build
|
|
CC=gcc-11 CXX=g++-11 cmake \
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
|
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
|
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
|
..
|
|
make -j4 unit_tests install
|
|
|
|
- name: 🧪 Perform Unit Tests
|
|
run: |
|
|
cd build
|
|
ctest |