Skip to content

add option to enable testing without nel unit tests #32

add option to enable testing without nel unit tests

add option to enable testing without nel unit tests #32

Workflow file for this run

name: "NeL: CI / CD"
on:
push:
branches: [ "core4", "feature/*" ]
paths:
- .github/workflows/ci-nel.yml
- nel/**
- CMakeLists.txt
- CMakePresets.json
pull_request:
branches: [ "core4" ]
paths:
- .github/workflows/ci-nel.yml
- nel/**
- CMakeLists.txt
- CMakePresets.json
jobs:
strings:
runs-on: ubuntu-latest
outputs:
build-output-dir: ${{ steps.strings.outputs.build-output-dir }}
build-version: ${{ steps.strings.outputs.build-version }}
project-name: ${{ steps.strings.outputs.project-name }}
steps:
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build/nel" >> "$GITHUB_OUTPUT"
COMMIT_HASH=${{ github.sha }}
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "main" ] && VERSION=latest
VERSION="$VERSION+sha.${COMMIT_HASH:0:8}"
echo VERSION=$VERSION
echo "build-version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "project-name=nel" >> "$GITHUB_OUTPUT"
build:
needs: [ strings ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04 ]
include:
- os: ubuntu-22.04
preset: linux-${{ needs.strings.outputs.project-name }}
steps:
- uses: actions/checkout@v4
- uses: lukka/get-cmake@latest
- uses: lukka/run-vcpkg@v11.5
- name: Dependencies Linux
if: runner.os == 'Linux'
run: |
sudo apt install --yes \
build-essential ccache \
bison autoconf automake \
libpng-dev \
libjpeg-dev \
libgif-dev libfreetype6-dev \
freeglut3-dev \
liblua5.2-dev libluabind-dev libcpptest-dev \
libogg-dev libvorbis-dev libopenal-dev \
libavcodec-dev libavformat-dev libavdevice-dev libswscale-dev libpostproc-dev \
libmysqlclient-dev \
libcurl4-openssl-dev libssl-dev \
libsquish-dev \
liblzma-dev \
libgsf-1-dev \
qtbase5-dev qttools5-dev qttools5-dev-tools \
- name: Configure CMake
run: cmake --preset ${{ matrix.preset }}
- name: Build
run: cmake --build --preset ${{ needs.strings.outputs.project-name }}
- name: Test
run: ctest --preset ${{ needs.strings.outputs.project-name }}
- name: Package
run: cpack --preset ${{ needs.strings.outputs.project-name }} -R "${{ needs.strings.outputs.build-version }}"
- uses: actions/upload-artifact@v4
with:
name: package-${{ needs.strings.outputs.project-name }}-${{ matrix.os }}-${{ needs.strings.outputs.build-version }}
path: ${{ needs.strings.outputs.build-output-dir }}/${{ needs.strings.outputs.project-name }}-*