1
0
mirror of https://github.com/rtbrick/bngblaster.git synced 2024-05-06 15:54:57 +00:00

66 lines
1.8 KiB
YAML
Raw Normal View History

2021-02-05 00:10:54 +01:00
name: Build
on:
push:
paths-ignore:
- 'docs/**'
2021-02-05 00:10:54 +01:00
env:
BUILD_TYPE: Release
jobs:
2021-02-05 10:46:48 +01:00
build:
2021-02-05 11:28:18 +01:00
name: Build ${{matrix.os}}
2021-02-05 10:46:48 +01:00
runs-on: ${{matrix.os}}
strategy:
matrix:
2022-05-25 15:23:21 +00:00
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04]
2021-02-05 00:10:54 +01:00
steps:
- uses: actions/checkout@v2
2021-05-26 19:39:12 +02:00
2021-02-05 10:46:48 +01:00
- name: Download RtBrick libdict
2021-02-05 00:10:54 +01:00
shell: bash
run: wget https://github.com/rtbrick/libdict/releases/download/v1.0.1/libdict-debian.zip
2021-05-26 19:39:12 +02:00
2021-02-05 10:46:48 +01:00
- name: Install RtBrick libdict
2021-02-05 00:10:54 +01:00
shell: bash
run: unzip libdict-debian.zip; sudo dpkg -i libdict_1.0.1_amd64.deb; sudo dpkg -i libdict-dev_1.0.1_amd64.deb
2021-05-26 19:39:12 +02:00
2021-02-05 10:46:48 +01:00
- name: Install Dependencies
2021-02-05 00:10:54 +01:00
shell: bash
run: sudo apt install -y libcunit1-dev libncurses5-dev libssl-dev libjansson-dev libcmocka-dev libpcap-dev
2021-05-26 19:39:12 +02:00
- name: Set export SOURCE_DATE_EPOCH to git commit time
run: |
echo "SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)" >> $GITHUB_ENV
2021-02-05 00:10:54 +01:00
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
2021-02-05 11:28:18 +01:00
run: cmake $GITHUB_WORKSPACE -DGIT_REF=$GITHUB_REF -DGIT_SHA=$GITHUB_SHA -DBNGBLASTER_TESTS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE
2021-02-05 00:10:54 +01:00
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -C $BUILD_TYPE
- name: Package
working-directory: ${{github.workspace}}/build
shell: bash
run: cpack -G DEB
- name: Upload Build Artifact
uses: actions/upload-artifact@v2
with:
2021-02-05 11:45:24 +01:00
name: bngblaster-${{matrix.os}}
2021-05-26 19:39:12 +02:00
path: ${{ github.workspace }}/build/*.deb