Skip to content

Commit

Permalink
IDE-1050 Add GH Action Test Build Action
Browse files Browse the repository at this point in the history
Signed-off-by: Gordon Smith <[email protected]>
  • Loading branch information
GordonSmith committed Dec 13, 2023
1 parent b9d6895 commit 8472459
Show file tree
Hide file tree
Showing 22 changed files with 200 additions and 700 deletions.
144 changes: 144 additions & 0 deletions .github/workflows/build-gh_runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: Build Package (gh-runner)

env:
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,read"
VCPKG_NUGET_REPOSITORY: "https://github.com/hpcc-systems/vcpkg"

on:
workflow_call:
inputs:
os:
type: string
description: 'Operating System'
required: false
default: 'windows-2022'
build-type:
type: string
description: 'CMake Build Type'
required: false
default: 'RelWithDebInfo'
cmake-configuration:
type: string
description: 'CMake Configuration'
required: false
default: ''
cmake-configuration-ex:
type: string
description: 'CMake Configuration Extra'
required: false
default: ''
update-cache:
type: boolean
description: 'Update Cache'
required: false
default: true
upload-package:
type: boolean
description: 'Upload Package as Asset'
required: false
default: false
asset-name:
type: string
description: 'Asset Name (if upload-package is true)'
required: false
default: 'build-package'
secrets:
LNB_TOKEN:
required: false

jobs:

build-gh_runner:
runs-on: ${{ inputs.os }}
steps:
- name: "Remove builtin vcpkg (old)"
working-directory: .
shell: "bash"
run: |
${{ !contains(inputs.os, 'windows') && 'sudo' || '' }} rm -rf "$VCPKG_INSTALLATION_ROOT"
- name: Checkout ECLIDE
uses: actions/checkout@v3
with:
submodules: recursive
path: ${{ github.workspace }}/eclide

- name: Fetch vcpkg history
shell: "bash"
working-directory: ${{ github.workspace }}/eclide/vcpkg
run: |
git fetch --unshallow
- name: "vcpkg Bootstrap"
shell: "bash"
run: |
./eclide/vcpkg/bootstrap-vcpkg.sh
- name: "Setup NuGet credentials"
shell: "bash"
run: |
`./eclide/vcpkg/vcpkg fetch nuget | tail -n 1` \
sources add \
-name "GitHub" \
-source "https://nuget.pkg.github.com/hpcc-systems/index.json" \
-storepasswordincleartext \
-username "${{ github.actor }}" \
-password "${{ secrets.GITHUB_TOKEN }}"
- name: Calculate vars
id: vars
working-directory: ${{ github.workspace }}/eclide/vcpkg
shell: "bash"
run: |
branch_label_1=${{ github.base_ref }}
branch_label_2=$(echo ${{ github.ref }} | cut -d'/' -f3)
echo "branch_label=${branch_label_1:-$branch_label_2}" >> $GITHUB_OUTPUT
vcpkg_sha_short=$(git rev-parse --short=8 HEAD)
echo "vcpkg_sha_short=$vcpkg_sha_short" >> $GITHUB_OUTPUT
- name: Print vars
shell: "bash"
run: |
echo "${{ toJSON(steps.vars.outputs) }}"
- uses: actions/cache@v3
id: cache
with:
path: |
${{github.workspace}}/build/vcpkg_installed
key: vcpkg-${{ inputs.os }}-${{ steps.vars.outputs.vcpkg_sha_short }}

- uses: hendrikmuhs/[email protected]
with:
save: ${{ inputs.update-cache == true }}
key: gh-runner-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}-eclide
restore-keys: |
gh-runner-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}-
gh-runner-${{ inputs.os }}-${{ inputs.build-type }}-
gh-runner-${{ inputs.os }}-
- name: CMake Configure
shell: "bash"
run: |
mkdir -p ${{ github.workspace }}/build
cmake -S ./eclide -B ./build -T host=x86 -A Win32 -DCMAKE_BUILD_TYPE=${{ inputs.build-type }}
- name: CMake Build
run: |
cmake --build ./build --config RelWithDebInfo --parallel ${{ inputs.upload-package == true && '--target package' || ''}}
- name: Upload Package
if: ${{ inputs.upload-package == true }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.asset-name }}
path: |
${{ github.workspace }}/build/*.exe
if-no-files-found: error

- name: Upload Error Logs
if: ${{ failure() || cancelled() }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.os }}-eclide-logs
path: ${{ github.workspace }}/build/**/*.log
155 changes: 37 additions & 118 deletions .github/workflows/build-vcpkg.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
name: Test Build

env:
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,read"
VCPKG_NUGET_REPOSITORY: "https://github.com/hpcc-systems/vcpkg"

on:
workflow_dispatch:
inputs:
os:
type: choice
options:
- 'windows-2022'
- 'windows-2019'
description: 'Operating System'
required: false
default: 'windows-2022'

# Do not include "push" in final version (uncomment for testing on users own repo)
# push:

pull_request:
branches:
- "master"
Expand All @@ -17,119 +27,28 @@ on:
- "!candidate-7.0.*"
- "!candidate-6.*"

jobs:
preamble:
name: Preamble
runs-on: ubuntu-22.04
outputs:
folder_platform: ${{ steps.vars.outputs.folder_platform }}
mount_platform: ${{ steps.vars.outputs.mount_platform }}
folder_ln: ${{ steps.vars.outputs.folder_ln }}
mount_ln: ${{ steps.vars.outputs.mount_ln }}
folder_build: ${{ steps.vars.outputs.folder_build }}
mount_build: ${{ steps.vars.outputs.mount_build }}
community_ref: ${{ steps.vars.outputs.community_ref }}
internal_ref: ${{ steps.vars.outputs.internal_ref }}
community_tag: ${{ steps.vars.outputs.community_tag }}
internal_tag: ${{ steps.vars.outputs.internal_tag }}
community_branch: ${{ steps.vars.outputs.community_branch }}
cmake_docker_config: ${{ steps.vars.outputs.cmake_docker_config }}
platform: "1"
platform_testing_do_not_release: ${{ steps.skip_check.outputs.platform }}
include_plugins: ${{ (steps.skip_check.outputs.plugins && 'ON') || 'OFF' }}
steps:
- name: Calculate vars
id: vars
run: |
echo "folder_platform=${{ github.workspace }}/eclide" >> $GITHUB_OUTPUT
echo 'mount_platform=source="${{ github.workspace }}/eclide",target=/hpcc-dev/eclide,type=bind,consistency=cached' >> $GITHUB_OUTPUT
echo "folder_ln=${{ github.workspace }}/LN" >> $GITHUB_OUTPUT
echo 'mount_ln=source="${{ github.workspace }}/LN",target=/hpcc-dev/LN,type=bind,consistency=cached' >> $GITHUB_OUTPUT
echo "folder_build=${{ github.workspace }}/build" >> $GITHUB_OUTPUT
echo 'mount_build=source="${{ github.workspace }}/build",target=/hpcc-dev/build,type=bind,consistency=cached' >> $GITHUB_OUTPUT
community_ref=${{ github.ref }}
echo "community_ref=$community_ref" >> $GITHUB_OUTPUT
echo "internal_ref=${{ github.base_ref }}" >> $GITHUB_OUTPUT
community_tag=$(echo $community_ref | cut -d'/' -f3)
echo "community_tag=$community_tag" >> $GITHUB_OUTPUT
echo "internal_tag=$(echo $community_tag | sed 's/community/internal/')" >> $GITHUB_OUTPUT
community_base_ref=${{ github.event.base_ref || github.ref }}
echo "community_branch=$(echo $community_base_ref | cut -d'/' -f3)" >> $GITHUB_OUTPUT
echo "cmake_docker_config=-DCMAKE_BUILD_TYPE=RelWithDebInfo -DVCPKG_FILES_DIR=/hpcc-dev -DCPACK_THREADS=0 -DUSE_OPTIONAL=OFF" >> $GITHUB_OUTPUT
- name: Print vars
run: |
echo "${{ toJSON(steps.vars.outputs) }})"
echo "${{ toJSON(steps.skip_check.outputs) }})"
build-bare-metal:
name: Build Bare Metal
needs: preamble
strategy:
matrix:
include:
- os: "windows-2019"
mono: ""
sudo: ""
cmake_config_options: '-G "Visual Studio 16 2019" -A Win32'
cmake_build_options: "--config RelWithDebInfo --parallel $NUMBER_OF_PROCESSORS"
event_name: "schedule"
- os: "windows-2022"
mono: ""
sudo: ""
cmake_config_options: '-G "Visual Studio 17 2022" -A Win32'
cmake_build_options: "--config RelWithDebInfo --parallel $NUMBER_OF_PROCESSORS"
event_name: "pull_request"
fail-fast: false

runs-on: ${{ matrix.os }}
steps:
- name: Print vars
shell: "bash"
run: |
echo ${{ matrix.os }}
echo "${{ toJSON(needs.preamble.outputs) }})"
schedule:
- cron: "0 0 * * *"

- name: "Remove builtin vcpkg (old)"
working-directory: .
shell: "bash"
run: |
${{ matrix.sudo }} rm -rf "$VCPKG_INSTALLATION_ROOT"
- name: Checkout eclide
uses: actions/[email protected]
with:
ref: ${{ needs.preamble.outputs.community_ref }}
submodules: recursive
path: ./eclide
fetch-depth: 0

- name: "vcpkg Bootstrap"
shell: "bash"
run: |
./eclide/vcpkg/bootstrap-vcpkg.sh
- name: "Setup NuGet credentials"
shell: "bash"
run: |
${{ matrix.mono }} `./eclide/vcpkg/vcpkg fetch nuget | tail -n 1` \
sources add \
-name "GitHub" \
-source "https://nuget.pkg.github.com/hpcc-systems/index.json" \
-storepasswordincleartext \
-username "${{ github.actor }}" \
-password "${{ secrets.GITHUB_TOKEN }}"
- name: CMake Packages
shell: "bash"
run: |
mkdir -p ./eclide/build
cmake -S ./eclide -B ./eclide/build ${{ matrix.cmake_config_options }}
cmake --build ./eclide/build ${{ matrix.cmake_build_options }}
jobs:

- name: Upload error logs
if: ${{ failure() || cancelled() }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-${{ matrix.package }}-logs
path: ./build/**/*.log
build-workflow-dispatch:
if: ${{ contains('workflow_dispatch', github.event_name) }}
uses: ./.github/workflows/build-gh_runner.yml
with:
os: ${{ inputs.os }}
secrets: inherit

build-gh_runner-windows-2022:
if: ${{ contains('pull_request,push', github.event_name) }}
uses: ./.github/workflows/build-gh_runner.yml
with:
os: windows-2022
secrets: inherit

build-gh_runner-windows-2019:
if: ${{ contains('schedule,push', github.event_name) }}
uses: ./.github/workflows/build-gh_runner.yml
with:
os: windows-2019
secrets: inherit
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.20)
set(VCPKG_FILES_DIR "${CMAKE_BINARY_DIR}" CACHE STRING "Folder for vcpkg download, build and installed files")
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake)
set(VCPKG_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg)
set(VCPKG_OVERLAY_PORTS ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg_overlays)
set(VCPKG_OVERLAY_PORTS ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg_overlays;${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/overlays)
set(VCPKG_INSTALLED_DIR "${VCPKG_FILES_DIR}/vcpkg_installed")
set(VCPKG_INSTALL_OPTIONS "--downloads-root=${VCPKG_FILES_DIR}/vcpkg_downloads;--x-buildtrees-root=${VCPKG_FILES_DIR}/vcpkg_buildtrees;--x-packages-root=${VCPKG_FILES_DIR}/vcpkg_packages")
set(VCPKG_VERBOSE OFF)
Expand Down
10 changes: 0 additions & 10 deletions comms/6_4_0/gsoap_build.bat

This file was deleted.

19 changes: 17 additions & 2 deletions comms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,25 @@ SET (GEN_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/6_4_0/soapWsWorkunitsServiceSoapProxy.cpp
)

SET (GEN_DEPS
${CMAKE_CURRENT_SOURCE_DIR}/6_4_0/Ws_Account.wsdl
${CMAKE_CURRENT_SOURCE_DIR}/6_4_0/WsAttributes.wsdl
${CMAKE_CURRENT_SOURCE_DIR}/6_4_0/WsDfu.wsdl
${CMAKE_CURRENT_SOURCE_DIR}/6_4_0/WsSMC.wsdl
${CMAKE_CURRENT_SOURCE_DIR}/6_4_0/WsStore.wsdl
${CMAKE_CURRENT_SOURCE_DIR}/6_4_0/WsTopology.wsdl
${CMAKE_CURRENT_SOURCE_DIR}/6_4_0/WsWorkunits.wsdl
)

SET(GSOAP "${CMAKE_BINARY_DIR}/vcpkg_installed/x86-windows/share/gsoap")
SET(GSOAP_BIN "${GSOAP}/bin/win32")

ADD_CUSTOM_COMMAND(
OUTPUT ${GEN_SRCS}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/6_4_0/gsoap_build.bat
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/6_4_0/gsoap_build.bat
DEPENDS ${GEN_DEPS}
COMMAND ${GSOAP_BIN}/wsdl2h.exe -I${GSOAP} -I./hpcc -o Services.h Ws_Account.wsdl WsAttributes.wsdl WsDfu.wsdl WsSMC.wsdl WsTopology.wsdl WsWorkunits.wsdl
COMMAND ${GSOAP_BIN}/soapcpp2.exe -C -x -i -I${GSOAP}/import Services.h
COMMAND ${GSOAP_BIN}/soapcpp2.exe -C -x -i -I${GSOAP}/import -penv ./hpcc/env.h
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/6_4_0
)

Expand Down
Empty file added vcpkg_overlays/.gitkeep
Empty file.
6 changes: 0 additions & 6 deletions vcpkg_overlays/boost-signals/CONTROL

This file was deleted.

16 changes: 0 additions & 16 deletions vcpkg_overlays/boost-signals/portfile.cmake

This file was deleted.

Loading

0 comments on commit 8472459

Please sign in to comment.