Skip to content

Fix/minor bug fix

Fix/minor bug fix #196

Workflow file for this run

name: Build k2eg with CMake
on:
pull_request:
types:
- opened
- synchronize
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check-changed-file:
runs-on: ubuntu-latest
name: Test changed source file
outputs:
source_changed: ${{ steps.changed-src.outputs.any_changed }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get changed files in the source folder
id: changed-src
uses: tj-actions/changed-files@v35
with:
files: |
CMakeLists.txt
src/**
test/**
- name: Set Build Ubuntu to success
if: steps.changed-src.outputs.any_changed == 'false'
uses: ouzi-dev/commit-status-updater@v2
with:
name: Build Ubuntu
status: success
- name: Set Test Ubuntu / test_build to success
if: steps.changed-src.outputs.any_changed == 'false'
uses: ouzi-dev/commit-status-updater@v2
with:
name: Test Ubuntu / test_build
status: success
test_ubuntu:
name: Test Ubuntu
needs: [build_ubuntu]
uses: ./.github/workflows/test.yml
with:
build_image: ${{ needs.build_ubuntu.outputs.build_image }}
artifact_name: ${{ needs.build_ubuntu.outputs.artifact_name }}
docker_compose_profile: app-ubuntu
secrets: inherit
build_ubuntu:
name: Build Ubuntu
needs: check-changed-file
if: needs.check-changed-file.outputs.source_changed == 'true'
runs-on: ubuntu-latest
container: docker.io/ubuntu:jammy
env:
BUILD_IMAGE: ubuntu:jammy
ARTIFACT_NAME: artifact-gcc-ubuntu
BUILD_TYPE: Debug
outputs:
build_image: ${{ env.BUILD_IMAGE }}
artifact_name: ${{ env.ARTIFACT_NAME}}
steps:
- name: Setup bild system
run: |
export DEBIAN_FRONTEND=noninteractive
apt update
apt install -y build-essential cmake git tclsh ninja-build lcov libsasl2-dev libssl-dev curl libcurl4-openssl-dev
- name: Checkout source code
uses: actions/checkout@v3
- name: Restore cached build directory
id: cache-build-restore
uses: actions/cache@v3
with:
path: build
key: ubuntu-kinetic-${{ hashFiles('CMakeLists.txt') }}
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_ASAN=1
- run: git config --global --add safe.directory '*'
- name: Build
run: cmake --build build --config ${{env.BUILD_TYPE}} --target install
- name: Get log on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: ${{env.ARTIFACT_NAME}}-log
path: build/**/*.log
retention-days: 1
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: ${{env.ARTIFACT_NAME}}
path: |
build/local/lib
build/local/bin
retention-days: 1
- name: Set job status
uses: ouzi-dev/commit-status-updater@v2
with:
status: success