Skip to content

Use out of source build for workflow. #832

Use out of source build for workflow.

Use out of source build for workflow. #832

name: "CodeQL"
on:
push:
branches: [ master, develop, g-maintenance ]
jobs:
codeql-analysis:
name: CodeQL Analysis
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
os: ['ubuntu-22.04']
language: [ 'cpp' ]
runs-on: ${{ matrix.os }}
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Configure build for analysis
run: |
sudo apt install -y doxygen libboost-all-dev libreadline-dev libssl-dev libtool ncurses-dev pkg-config python3 python3-dev python3-jinja2 python3-pip libsnappy-dev libbz2-dev liburing-dev
cmake -DCMAKE_BUILD_TYPE=Release .
- name: Run build for analysis
run: |
make hived cli_wallet
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
build:
name: Build on a self hosted runner
runs-on: self-hosted
steps:
- name: Get runner info
run: |
hostname -A
id
pwd
free -m
nproc
- name: Checkout the code
run: |
git clone https://github.com/openhive-network/hive
cd hive
git submodule update --init --recursive
- name: Get the prerequisites
run: |
sudo DEBIAN_FRONTEND=noninteractive apt install -y doxygen libboost-all-dev libreadline-dev libssl-dev libtool ncurses-dev pkg-config python3 python3-dev python3-jinja2 python3-pip libsnappy-dev libbz2-dev liburing-dev cmake
- name: Configure the build
run: |
pwd
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../hive
- name: Build
run: |
pwd
cd build
time make -j4