Initial Linux GHA build

This commit is contained in:
Simon Walton 2019-11-20 16:15:39 -08:00
parent 37a46d91fa
commit 27d3b493fa
4 changed files with 88 additions and 15 deletions

View file

@ -246,3 +246,42 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }}
ARTIFACT_PATTERN: HighFidelity-Beta-PR${{ github.event.number }}-*.exe
run: python "$GITHUB_WORKSPACE\tools\ci-scripts\upload.py"
build_full_linux:
runs-on: ubuntu-latest
if: github.event.action != 'labeled' || github.event.label.name == 'rebuild-win' || github.event.label.name == 'rebuild'
env:
DOCKER_IMAGE_NAME: "linux-hifi-gha:${{ github.event.number }}"
steps:
- uses: actions/checkout@v1
with:
submodules: true
fetch-depth: 1
- name: Install python modules
run: pip install awscli boto3 PyGithub
- name: Install apt packages
# libglu1-mesa-dev needed for oven, npm for server-console
run: sudo apt install -y mesa-common-dev libegl1 libglvnd-dev libdouble-conversion1 libpulse0
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake (Linux)
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_TOOLS:BOOLEAN=false
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build
# Parallel make:
run: cmake --build . -- -j3
- name: Build Ubuntu Docker
shell: bash
working-directory: ${{runner.workspace}}/build
run: docker build -t $DOCKER_IMAGE_NAME -f $GITHUB_WORKSPACE/tools/ci-scripts/linux-gha/Dockerfile ./
- name: Upload Docker image
shell: bash
env:
# TODO: upload to correct location
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
run: |
docker save -o ${{runner.workspace}}/build/hifi_docker_image.tar $DOCKER_IMAGE_NAME
aws s3 cp ${{runner.workspace}}/build/hifi_docker_image.tar s3://hifi-public/simon/builds/hifi_docker_image.$GIT_PR_COMMIT_SHORT.tar

View file

@ -274,7 +274,9 @@ endif()
if (BUILD_CLIENT OR BUILD_SERVER)
add_subdirectory(plugins)
add_subdirectory(server-console)
if (NOT (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND "$ENV{CI_BUILD}" STREQUAL "Github"))
add_subdirectory(server-console)
endif()
endif()
# BUILD_TOOLS option will be handled inside the tools's CMakeLists.txt because 'scribe' tool is required for build anyway

View file

@ -18,21 +18,23 @@ link_hifi_libraries(
)
include_hifi_library_headers(procedural)
add_dependencies(${TARGET_NAME} oven)
if (BUILD_TOOLS)
add_dependencies(${TARGET_NAME} oven)
if (WIN32)
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
$<TARGET_FILE_DIR:oven>
$<TARGET_FILE_DIR:${TARGET_NAME}>)
else()
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E create_symlink
$<TARGET_FILE:oven>
$<TARGET_FILE_DIR:${TARGET_NAME}>/oven)
endif()
if (WIN32)
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
$<TARGET_FILE_DIR:oven>
$<TARGET_FILE_DIR:${TARGET_NAME}>)
else()
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E create_symlink
$<TARGET_FILE:oven>
$<TARGET_FILE_DIR:${TARGET_NAME}>/oven)
endif()
endif (BUILD_TOOLS)
if (WIN32)
package_libraries_for_deployment()

View file

@ -0,0 +1,30 @@
FROM simonwalton1/hifi_base_ubuntu:1.0
MAINTAINER DevOps Team (devops@highfidelity.io)
EXPOSE 40100 40101 40102
EXPOSE 40100/udp 40101/udp 40102/udp
EXPOSE 48000/udp 48001/udp 48002/udp 48003/udp 48004/udp 48005/udp 48006/udp
RUN mkdir -p /etc/hifi/server/plugins /etc/hifi/server/resources /etc/hifi/server/imageformats/ && \
ln -s /usr/local/Qt5.12.3/5.12.3/gcc_64/plugins/imageformats/* /etc/hifi/server/imageformats/
COPY ./assignment-client /etc/hifi/server/
#COPY ./oven /etc/hifi/server/
COPY ./domain-server /etc/hifi/server/
COPY ./plugins/hifiCodec/libhifiCodec.so /etc/hifi/server/plugins/
COPY ./plugins/pcmCodec/libpcmCodec.so /etc/hifi/server/plugins/
# Dummy statement
RUN true
COPY ./*.so /lib/
RUN ln -sf /lib/libquazip5.so /lib/libquazip5.so.1
#COPY ./resources/ /etc/hifi/server/resources/
#COPY ./supervisor/hifi.conf /etc/supervisor/conf.d/hifi.conf
RUN for fn in /usr/local/Qt5.12.3/5.12.3/gcc_64/plugins/imageformats/*.so; do \
if [ ! -x $fn ]; then ln -s $fn /etc/hifi/server/imageformats; fi; done
RUN chmod +x /etc/hifi/server/domain-server
RUN chmod +x /etc/hifi/server/assignment-client
# Ensure `domain-server` and `assignment-client` execute.
RUN /etc/hifi/server/domain-server --version > /etc/hifi/server/version && \
/etc/hifi/server/assignment-client --version >> /etc/hifi/server/version
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/hifi.conf"]