test: [RLOS2023] Add new e2e test framework for vw (#4644) #10
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
name: Native Nugets | |
on: | |
push: | |
branches: | |
- master | |
- 'releases/**' | |
pull_request: | |
branches: | |
- '*' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
build_nuget_windows: | |
name: nuget.${{ matrix.toolset }}.${{ matrix.arch_config.arch }} | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
os: ["windows-2019"] | |
toolset: ["v141", "v142"] | |
arch_config: | |
- { arch: x64, generator_arch: x64} | |
steps: | |
# Get repository and setup dependencies | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- uses: ilammy/msvc-dev-cmd@v1 | |
# Get version number | |
- name: Update git tags | |
# Needed because actions/checkout performs a shallow checkout without tags | |
run: git fetch --unshallow --tags --recurse-submodules=no | |
- name: Get version number | |
id: get_version | |
shell: bash | |
run: | | |
version=$(./utl/version_number.py) | |
echo "Generated version number: $version" | |
echo "version=$version" >> $GITHUB_OUTPUT | |
# Compile code | |
- name: Configure | |
run: > | |
cmake -S . -B build | |
-G "Visual Studio 16 2019" -A ${{ matrix.arch_config.generator_arch }} | |
-T ${{ matrix.toolset }} | |
-DVW_NUGET_PACKAGE_VERSION="${{ steps.get_version.outputs.version }}" | |
-DNATIVE_NUGET_PLATFORM_TAG="${{ matrix.arch_config.arch }}" | |
-DVW_FEAT_FLATBUFFERS=Off | |
-DBUILD_TESTING=Off | |
-DRAPIDJSON_SYS_DEP=Off | |
-DFMT_SYS_DEP=Off | |
-DSPDLOG_SYS_DEP=Off | |
-DVW_ZLIB_SYS_DEP=Off | |
-DVW_BOOST_MATH_SYS_DEP=Off | |
-DVW_BUILD_VW_C_WRAPPER=Off | |
-DVW_INSTALL=On | |
- name: Build and install | |
run: | | |
cmake --build build --config Debug -t vw_io vw_core vw_cli_bin vw_allreduce vw_spanning_tree_bin vw_c_wrapper vw_cache_parser vw_text_parser vw_json_parser | |
cmake --build build --config Release -t vw_io vw_core vw_cli_bin vw_allreduce vw_spanning_tree_bin vw_c_wrapper vw_cache_parser vw_text_parser vw_json_parser | |
# Install debug first so that release overwrites the exe and nothing else | |
cmake --install build --prefix ./nuget_staging --config Debug | |
cmake --install build --prefix ./nuget_staging --config Release | |
# Create package | |
- if: ${{ matrix.arch_config.arch == 'x64' }} | |
run: cp nuget\native\vowpalwabbit-x64.targets nuget_staging\vowpalwabbit.targets | |
- name: Package | |
shell: powershell | |
id: generate-nuget | |
run: | | |
cp build\nuget\native\vowpalwabbit.nuspec nuget_staging\vowpalwabbit.nuspec | |
cd nuget_staging | |
nuget pack .\vowpalwabbit.nuspec | |
$NugetFileName = Get-ChildItem *.nupkg -name | |
echo "NugetFileName=$NugetFileName" >> $GITHUB_OUTPUT | |
- name: Upload | |
uses: actions/upload-artifact@v1 | |
with: | |
name: VowpalWabbitNative-${{matrix.toolset}}-x64.${{ steps.get_version.outputs.version }}.nupkg | |
path: nuget_staging/${{ steps.generate-nuget.outputs.NugetFileName }} | |
test_nuget_windows: | |
needs: [build_nuget_windows] | |
name: nuget-test.${{ matrix.toolset }} | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
os: ["windows-2019"] | |
toolset: ["v141", "v142"] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- uses: ilammy/msvc-dev-cmd@v1 | |
- name: Add msbuild to PATH | |
uses: microsoft/[email protected] | |
# Get version number | |
- name: Update git tags | |
# Needed because actions/checkout performs a shallow checkout without tags | |
run: git fetch --unshallow --tags --recurse-submodules=no | |
- name: Get version number | |
id: get_version | |
shell: bash | |
run: | | |
version=$(./utl/version_number.py) | |
echo "Generated version number: $version" | |
echo "version=$version" >> $GITHUB_OUTPUT | |
# Download and install nuget | |
- uses: actions/download-artifact@v1 | |
with: | |
name: VowpalWabbitNative-${{matrix.toolset}}-x64.${{ steps.get_version.outputs.version }}.nupkg | |
path: downloaded_nugets | |
- name: List downloaded files | |
run: ls downloaded_nugets | |
- name: Install nuget | |
run: > | |
nuget install | |
-Source "${{ github.workspace }}\downloaded_nugets" | |
-OutputDirectory "${{ github.workspace }}\nuget\native\test\packages" | |
-Version "${{ steps.get_version.outputs.version }}" | |
-Verbosity detailed | |
-NonInteractive | |
VowpalWabbitNative-${{ matrix.toolset }}-x64 | |
- name: Rename package install directory to omit version number | |
run: | | |
cd nuget\native\test\packages | |
mv * VowpalWabbitNative-${{ matrix.toolset }}-x64 | |
# Compile and run | |
- name: Test nuget | |
run: | | |
cd nuget\native\test | |
echo "Testing debug build..." | |
msbuild test-${{ matrix.toolset }}.vcxproj -t:rebuild "-property:Configuration=Debug;Platform=x64" | |
.\bin\x64\Debug\test-${{ matrix.toolset }}.exe | |
echo "Testing release build..." | |
msbuild test-${{ matrix.toolset }}.vcxproj -t:rebuild "-property:Configuration=Release;Platform=x64" | |
.\bin\x64\Release\test-${{ matrix.toolset }}.exe |