diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 2c4135e0cf1..d7a92b3b409 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -10,16 +10,12 @@ inputs: runs: using: composite steps: - - name: dependencies - uses: ./.github/actions/dependencies - with: - configuration: ${{ inputs.configuration }} - name: configure shell: bash run: | cd ${build_dir} 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_BUILD_TYPE=${{ inputs.configuration }} \ ${{ inputs.cmake-args }} \ diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 1ebb9f690bb..120a6ec1782 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -37,6 +37,10 @@ jobs: run : | conan profile get env.CXXFLAGS default || true conan profile update 'conf.tools.build:cxxflags+=["-DBOOST_ASIO_DISABLE_CONCEPTS"]' default + - name: dependencies + uses: ./.github/actions/dependencies + with: + configuration: ${{ matrix.configuration }} - name: build uses: ./.github/actions/build with: diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 4198369e78a..fb017d45bf7 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -88,7 +88,7 @@ jobs: # 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 --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 if: (steps.binaries.outputs.missing != '[]') uses: ./.github/actions/dependencies @@ -146,6 +146,10 @@ jobs: ls ~/.conan - name: checkout uses: actions/checkout@v3 + - name: dependencies + uses: ./.github/actions/dependencies + with: + configuration: ${{ matrix.configuration }} - name: build uses: ./.github/actions/build with: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 0f918a50959..4988e323e2b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,19 +1,11 @@ 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 -# test environments, nor have we gone through the trouble of setting up an -# interactive CI Windows environment. -# We welcome contributions to diagnose or debug the problems on Windows. Until -# then, we leave this tombstone as a reminder that we have tried (but failed) -# to write a reliable test for Windows. -# on: [push, pull_request] -on: - workflow_dispatch: - push: - branches: - - 'action' - paths: - - '.github/workflow/windows.yml' + +on: [push, pull_request] + +# https://docs.github.com/en/actions/using-jobs/using-concurrency +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: @@ -25,6 +17,11 @@ jobs: - Visual Studio 16 2019 configuration: - 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 env: build_dir: .build @@ -37,11 +34,12 @@ jobs: python-version: 3.9 - name: learn Python cache directory id: pip-cache + shell: bash run: | pip install --upgrade pip - echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT + echo "dir=$(pip cache dir)" | tee ${GITHUB_OUTPUT} - name: restore Python cache directory - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-${{ hashFiles('.github/workflows/windows.yml') }} @@ -55,45 +53,48 @@ jobs: cmake --version dir env: - name: configure Conan + shell: bash + env: + CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod run: | conan profile new default --detect - conan profile update settings.compiler.cppstd=20 default - conan profile update settings.compiler.runtime=MT default - conan profile update settings.compiler.toolset=v141 default - - name: learn Conan cache directory - id: conan-cache - run: | - echo "dir=$(conan config get storage.path)" >> $GITHUB_OUTPUT - - name: restore Conan cache directory - uses: actions/cache@v2 - with: - path: ${{ steps.conan-cache.outputs.dir }} - key: ${{ hashFiles('~/.conan/profiles/default', 'conanfile.py', 'external/rocksdb/*', '.github/workflows/windows.yml') }} - - name: export custom recipes + conan profile update settings.compiler.runtime=MT${{ matrix.configuration == 'Debug' && 'd' || '' }} default + # Do not quote the URL. An empty string will be accepted (with + # a non-fatal warning), but a missing argument will not. + conan remote add ripple ${{ env.CONAN_URL }} --insert 0 + - name: try to authenticate to ripple Conan remote + shell: bash + id: remote run: | - conan export external/snappy snappy/1.1.9@ - conan export external/soci soci/4.0.3@ - - name: install dependencies + echo outcome=$(conan user --remote ripple ${{ secrets.CONAN_USERNAME }} \ + --password ${{ secrets.CONAN_TOKEN }} >&2 && echo success || \ + 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: | - 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 ` - .. + 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: + configuration: ${{ matrix.configuration }} + - name: upload dependencies to remote + if: (steps.binaries.outputs.missing != '[]') && (steps.remote.outputs.outcome == 'success') + run: conan upload --remote ripple '*' --all --parallel --confirm - 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: | - cmake --build $env:build_dir --target rippled --config ${{ matrix.configuration }} --parallel $env:NUMBER_OF_PROCESSORS - - name: test - run: | - & "$env:build_dir\${{ matrix.configuration }}\rippled.exe" --unittest + ${build_dir}/${{ matrix.configuration }}/rippled --unittest --unittest-jobs $(nproc)