Skip to content

Show results of self-hosted workflow. #835

Show results of self-hosted workflow.

Show results of self-hosted workflow. #835

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: Cleanup
run: |
rm -rf build hive
- 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 build-essential clang clang-tidy cmake doxygen libboost-all-dev libbz2-dev libglib2.0-0 libglib2.0-data libncurses5-dev libreadline-dev libsnappy-dev libssl-dev libtool liburing-dev libxml2 make ncurses-dev ninja-build perl pkg-config python3 python3-dev python3-jinja2 wget xxd
- name: Configure the build
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../hive
- name: Build
run: |
cd build
time make -j4
- name: Results
run: |
ls -lad build/programs/hived/hived build/programs/cli_wallet/cli_wallet
chmod 755 build/programs/hived/hived build/programs/cli_wallet/cli_wallet
./build/programs/hived --version