-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from microsoft/dockerbuildgithub
Add GitHub workflow to build repository using Docker image
- Loading branch information
Showing
8 changed files
with
243 additions
and
49 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
set -euf -o pipefail | ||
|
||
REPOSITORY_ROOT=${1:-${PWD}} | ||
|
||
# Verify the repository root is a git repository. | ||
if [[ ! -d ${REPOSITORY_ROOT}/.git ]]; then | ||
echo "Repository root is not a git repository: ${REPOSITORY_ROOT}" | ||
exit 1 | ||
fi | ||
|
||
# Verify the vcpkg toolchain file is present. | ||
if [[ ! -f ${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake ]]; then | ||
echo "vcpkg cmake toolchain file not found: ${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" | ||
exit 1 | ||
fi | ||
|
||
# Assign cmake presets. | ||
# TODO: these should be passed in as arguments instead. | ||
PRESET_CONFIGURE=release-linux | ||
PRESET_BUILD=release-linux-debug | ||
BUILD_CONFIG=Debug | ||
|
||
# Add the workspace directory to the safe directory list. | ||
git config --global --add safe.directory ${REPOSITORY_ROOT} | ||
|
||
# Change to the root of the repo. | ||
cd ${REPOSITORY_ROOT} | ||
cmake --preset ${PRESET_CONFIGURE} | ||
cmake --build --preset ${PRESET_BUILD} | ||
cmake --install out/build/${PRESET_CONFIGURE} --config ${BUILD_CONFIG} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "netremote", | ||
"version-string": "1", | ||
"dependencies": [ | ||
{ | ||
"name": "grpc", | ||
"host": true | ||
}, | ||
"cli11", | ||
"protobuf", | ||
"catch2", | ||
"plog", | ||
"magic-enum", | ||
{ | ||
"name": "wil", | ||
"platform": "windows" | ||
} | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
name: 'Build' | ||
description: 'Build the repository in a Docker container' | ||
runs: | ||
using: 'docker' | ||
image: 'docker://abeltrano/netremote-build:latest' | ||
args: | ||
- '/github/workspace' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Build in container | ||
uses: ./.github/actions/build-with-docker | ||
|
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
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
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