fixes #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build xApp Binary | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
E2AP_VERSION: E2AP_V3 | |
KPM_VERSION: KPM_V3_00 | |
C_COMPILER: gcc-13 | |
CPP_COMPILER: g++-13 | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Setup and install Swig | |
uses: mmomtchev/setup-swig@v1 | |
with: | |
version: v4.2.1 | |
- name: Install dependencies | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: | | |
libsctp-dev \ | |
libpcre2-dev \ | |
ninja-build | |
- name: Configure CMake | |
run: | | |
cmake -B ${{github.workspace}}/build \ | |
-GNinja -DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ | |
-DE2AP_VERSION=${{env.E2AP_VERSION}} \ | |
-DKPM_VERSION=${{env.KPM_VERSION}} \ | |
-DCMAKE_C_FLAGS_RELEASE="-O3" \ | |
-DCMAKE_CXX_FLAGS_RELEASE="-O3" \ | |
-DCMAKE_C_COMPILER=${{env.C_COMPILER}} \ | |
-DCMAKE_CXX_COMPILER=${{env.CPP_COMPILER}} | |
- name: Build xApp and service models | |
working-directory: ${{github.workspace}}/build | |
run: | | |
ninja xapp_iqos \ | |
libkpm_sm.so \ | |
librc_sm.so \ | |
libmac_sm.so \ | |
libslice_sm.so \ | |
libpdcp_sm.so \ | |
libgtp_sm.so \ | |
libtc_sm.so \ | |
librlc_sm.so | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{env.BUILD_TYPE}} | |
- name: Copy binaries | |
run: bash scripts/cpRicFiles.sh | |
- name: Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
muriloavlis/iqos-xapp | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push Docker image to Docker Hub | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: "docker/Dockerfile" | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |