mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 19:15:54 +00:00
ci: reenable Windows CI build with Artifactory support (#4596)
Artifactory support was added to the `nix` builds with #4556. This extends that support to the Windows build. Now the Windows build works; CI will build and test a Windows release build. This only affects CI and does not change any C++ code. * Copy the remote setup step outcome fix from #4716 discussion * Allow the Windows job to succeed if tests fail: * Currently the tests do not always pass, even on a single threaded run on the GitHub runners. So we are using parallel runs and mark the test step as allowed to fail (continue-on-error). * At this point, it's more important that the build succeeds than that the tests succeed, because: * We've got plenty of test coverage on the other jobs. * Test failures are much rarer than build failures because of cross-platform issues. * Having a test failure locally doesn't interrupt a workflow nearly as much as a build failure. Note that Conan Center cannot hold the binaries we need. They do not build the configurations we need, and they will not add them. ## Future Tasks This introduces a new bottleneck since the build and test takes over an hour. Speed up the job by: * Making this job run on heavy Windows runners. * Increasing the number of hardware threads.
This commit is contained in:
6
.github/actions/build/action.yml
vendored
6
.github/actions/build/action.yml
vendored
@@ -10,16 +10,12 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: dependencies
|
|
||||||
uses: ./.github/actions/dependencies
|
|
||||||
with:
|
|
||||||
configuration: ${{ inputs.configuration }}
|
|
||||||
- name: configure
|
- name: configure
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd ${build_dir}
|
cd ${build_dir}
|
||||||
cmake \
|
cmake \
|
||||||
${{ inputs.generator && format('-G {0}', inputs.generator) || '' }} \
|
${{ inputs.generator && format('-G "{0}"', inputs.generator) || '' }} \
|
||||||
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
|
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
|
||||||
-DCMAKE_BUILD_TYPE=${{ inputs.configuration }} \
|
-DCMAKE_BUILD_TYPE=${{ inputs.configuration }} \
|
||||||
${{ inputs.cmake-args }} \
|
${{ inputs.cmake-args }} \
|
||||||
|
|||||||
4
.github/workflows/macos.yml
vendored
4
.github/workflows/macos.yml
vendored
@@ -37,6 +37,10 @@ jobs:
|
|||||||
run : |
|
run : |
|
||||||
conan profile get env.CXXFLAGS default || true
|
conan profile get env.CXXFLAGS default || true
|
||||||
conan profile update 'conf.tools.build:cxxflags+=["-DBOOST_ASIO_DISABLE_CONCEPTS"]' default
|
conan profile update 'conf.tools.build:cxxflags+=["-DBOOST_ASIO_DISABLE_CONCEPTS"]' default
|
||||||
|
- name: dependencies
|
||||||
|
uses: ./.github/actions/dependencies
|
||||||
|
with:
|
||||||
|
configuration: ${{ matrix.configuration }}
|
||||||
- name: build
|
- name: build
|
||||||
uses: ./.github/actions/build
|
uses: ./.github/actions/build
|
||||||
with:
|
with:
|
||||||
|
|||||||
6
.github/workflows/nix.yml
vendored
6
.github/workflows/nix.yml
vendored
@@ -88,7 +88,7 @@ jobs:
|
|||||||
# Print the list of dependencies that would need to be built locally.
|
# Print the list of dependencies that would need to be built locally.
|
||||||
# A non-empty list means we have "failed" to cache binaries remotely.
|
# A non-empty list means we have "failed" to cache binaries remotely.
|
||||||
run: |
|
run: |
|
||||||
echo missing=$(conan info . --build missing --json 2>/dev/null | grep '^\[') | tee ${GITHUB_OUTPUT}
|
echo missing=$(conan info . --build missing --settings build_type=${{ matrix.configuration }} --json 2>/dev/null | grep '^\[') | tee ${GITHUB_OUTPUT}
|
||||||
- name: build dependencies
|
- name: build dependencies
|
||||||
if: (steps.binaries.outputs.missing != '[]')
|
if: (steps.binaries.outputs.missing != '[]')
|
||||||
uses: ./.github/actions/dependencies
|
uses: ./.github/actions/dependencies
|
||||||
@@ -146,6 +146,10 @@ jobs:
|
|||||||
ls ~/.conan
|
ls ~/.conan
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
- name: dependencies
|
||||||
|
uses: ./.github/actions/dependencies
|
||||||
|
with:
|
||||||
|
configuration: ${{ matrix.configuration }}
|
||||||
- name: build
|
- name: build
|
||||||
uses: ./.github/actions/build
|
uses: ./.github/actions/build
|
||||||
with:
|
with:
|
||||||
|
|||||||
107
.github/workflows/windows.yml
vendored
107
.github/workflows/windows.yml
vendored
@@ -1,19 +1,11 @@
|
|||||||
name: windows
|
name: windows
|
||||||
# We have disabled this workflow because it fails in our CI Windows
|
|
||||||
# environment, but we cannot replicate the failure in our personal Windows
|
on: [push, pull_request]
|
||||||
# test environments, nor have we gone through the trouble of setting up an
|
|
||||||
# interactive CI Windows environment.
|
# https://docs.github.com/en/actions/using-jobs/using-concurrency
|
||||||
# We welcome contributions to diagnose or debug the problems on Windows. Until
|
concurrency:
|
||||||
# then, we leave this tombstone as a reminder that we have tried (but failed)
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
# to write a reliable test for Windows.
|
cancel-in-progress: true
|
||||||
# on: [push, pull_request]
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'action'
|
|
||||||
paths:
|
|
||||||
- '.github/workflow/windows.yml'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@@ -25,6 +17,11 @@ jobs:
|
|||||||
- Visual Studio 16 2019
|
- Visual Studio 16 2019
|
||||||
configuration:
|
configuration:
|
||||||
- Release
|
- Release
|
||||||
|
# Github hosted runners tend to hang when running Debug unit tests.
|
||||||
|
# Instead of trying to work around it, disable the Debug job until
|
||||||
|
# something beefier (i.e. a heavy self-hosted runner) becomes
|
||||||
|
# available.
|
||||||
|
# - Debug
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
env:
|
env:
|
||||||
build_dir: .build
|
build_dir: .build
|
||||||
@@ -37,11 +34,12 @@ jobs:
|
|||||||
python-version: 3.9
|
python-version: 3.9
|
||||||
- name: learn Python cache directory
|
- name: learn Python cache directory
|
||||||
id: pip-cache
|
id: pip-cache
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
|
echo "dir=$(pip cache dir)" | tee ${GITHUB_OUTPUT}
|
||||||
- name: restore Python cache directory
|
- name: restore Python cache directory
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.pip-cache.outputs.dir }}
|
path: ${{ steps.pip-cache.outputs.dir }}
|
||||||
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/windows.yml') }}
|
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/windows.yml') }}
|
||||||
@@ -55,45 +53,48 @@ jobs:
|
|||||||
cmake --version
|
cmake --version
|
||||||
dir env:
|
dir env:
|
||||||
- name: configure Conan
|
- name: configure Conan
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
|
||||||
run: |
|
run: |
|
||||||
conan profile new default --detect
|
conan profile new default --detect
|
||||||
conan profile update settings.compiler.cppstd=20 default
|
conan profile update settings.compiler.runtime=MT${{ matrix.configuration == 'Debug' && 'd' || '' }} default
|
||||||
conan profile update settings.compiler.runtime=MT default
|
# Do not quote the URL. An empty string will be accepted (with
|
||||||
conan profile update settings.compiler.toolset=v141 default
|
# a non-fatal warning), but a missing argument will not.
|
||||||
- name: learn Conan cache directory
|
conan remote add ripple ${{ env.CONAN_URL }} --insert 0
|
||||||
id: conan-cache
|
- name: try to authenticate to ripple Conan remote
|
||||||
|
shell: bash
|
||||||
|
id: remote
|
||||||
run: |
|
run: |
|
||||||
echo "dir=$(conan config get storage.path)" >> $GITHUB_OUTPUT
|
echo outcome=$(conan user --remote ripple ${{ secrets.CONAN_USERNAME }} \
|
||||||
- name: restore Conan cache directory
|
--password ${{ secrets.CONAN_TOKEN }} >&2 && echo success || \
|
||||||
uses: actions/cache@v2
|
echo failure) | tee ${GITHUB_OUTPUT}
|
||||||
|
- name: list missing binaries
|
||||||
|
id: binaries
|
||||||
|
shell: bash
|
||||||
|
# Print the list of dependencies that would need to be built locally.
|
||||||
|
# A non-empty list means we have "failed" to cache binaries remotely.
|
||||||
|
run: |
|
||||||
|
echo missing=$(conan info . --build missing --settings build_type=${{ matrix.configuration }} --json 2>/dev/null | grep '^\[') | tee ${GITHUB_OUTPUT}
|
||||||
|
- name: build dependencies
|
||||||
|
uses: ./.github/actions/dependencies
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.conan-cache.outputs.dir }}
|
configuration: ${{ matrix.configuration }}
|
||||||
key: ${{ hashFiles('~/.conan/profiles/default', 'conanfile.py', 'external/rocksdb/*', '.github/workflows/windows.yml') }}
|
- name: upload dependencies to remote
|
||||||
- name: export custom recipes
|
if: (steps.binaries.outputs.missing != '[]') && (steps.remote.outputs.outcome == 'success')
|
||||||
run: |
|
run: conan upload --remote ripple '*' --all --parallel --confirm
|
||||||
conan export external/snappy snappy/1.1.9@
|
|
||||||
conan export external/soci soci/4.0.3@
|
|
||||||
- name: install dependencies
|
|
||||||
run: |
|
|
||||||
mkdir $env:build_dir
|
|
||||||
cd $env:build_dir
|
|
||||||
conan install .. --build missing --settings build_type=${{ matrix.configuration }}
|
|
||||||
- name: configure
|
|
||||||
run: |
|
|
||||||
$env:build_dir
|
|
||||||
cd $env:build_dir
|
|
||||||
pwd
|
|
||||||
ls
|
|
||||||
cmake `
|
|
||||||
-G "${{ matrix.generator }}" `
|
|
||||||
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake `
|
|
||||||
-Dassert=ON `
|
|
||||||
-Dreporting=OFF `
|
|
||||||
-Dunity=OFF `
|
|
||||||
..
|
|
||||||
- name: build
|
- name: build
|
||||||
|
uses: ./.github/actions/build
|
||||||
|
with:
|
||||||
|
generator: '${{ matrix.generator }}'
|
||||||
|
configuration: ${{ matrix.configuration }}
|
||||||
|
# Hard code for now. Move to the matrix if varied options are needed
|
||||||
|
cmake-args: '-Dassert=ON -Dreporting=OFF -Dunity=OFF'
|
||||||
|
- name: test (permitted to silently fail)
|
||||||
|
shell: bash
|
||||||
|
# Github runners are resource limited, which causes unit tests to fail
|
||||||
|
# (e.g. OOM). To allow forward progress until self-hosted runners are
|
||||||
|
# up and running reliably, allow the job to succeed even if tests fail.
|
||||||
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
cmake --build $env:build_dir --target rippled --config ${{ matrix.configuration }} --parallel $env:NUMBER_OF_PROCESSORS
|
${build_dir}/${{ matrix.configuration }}/rippled --unittest --unittest-jobs $(nproc)
|
||||||
- name: test
|
|
||||||
run: |
|
|
||||||
& "$env:build_dir\${{ matrix.configuration }}\rippled.exe" --unittest
|
|
||||||
|
|||||||
Reference in New Issue
Block a user