-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change makes progress on the plan in #4371. It does not replicate the full [matrix] implemented in #3851, but it does replicate the 1.ii section of the Linux matrix. It leverages "heavy" self-hosted runners, and demonstrates a repeatable pattern for future matrices. [matrix]: https://github.com/XRPLF/rippled/blob/d794a0f3f161bb30c74881172fc38f763d7d46e8/.github/README.md#continuous-integration
- Loading branch information
1 parent
8d482d3
commit 436de0e
Showing
4 changed files
with
197 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: build | ||
inputs: | ||
generator: | ||
default: null | ||
configuration: | ||
required: true | ||
cmake-args: | ||
default: null | ||
# An implicit input is the environment variable `build_dir`. | ||
runs: | ||
using: composite | ||
steps: | ||
- name: export custom recipes | ||
shell: bash | ||
run: conan export external/snappy snappy/1.1.9@ | ||
- name: install dependencies | ||
shell: bash | ||
run: | | ||
mkdir ${build_dir} | ||
cd ${build_dir} | ||
conan install \ | ||
--output-folder . \ | ||
--build missing \ | ||
--settings build_type=${{ inputs.configuration }} \ | ||
.. | ||
- name: configure | ||
shell: bash | ||
run: | | ||
cd ${build_dir} | ||
cmake \ | ||
${{ inputs.generator && format('-G {0}', inputs.generator) || '' }} \ | ||
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \ | ||
-DCMAKE_BUILD_TYPE=${{ inputs.configuration }} \ | ||
${{ inputs.cmake-args }} \ | ||
.. | ||
- name: build | ||
shell: bash | ||
run: | | ||
cmake \ | ||
--build ${build_dir} \ | ||
--config ${{ inputs.configuration }} \ | ||
--parallel ${NUM_PROCESSORS:-$(nproc)} |
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,69 @@ | ||
name: macos | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
test: | ||
strategy: | ||
matrix: | ||
platform: | ||
- macos-12 | ||
generator: | ||
- Ninja | ||
configuration: | ||
- Release | ||
runs-on: ${{ matrix.platform }} | ||
env: | ||
# The `build` action requires these variables. | ||
build_dir: .build | ||
NUM_PROCESSORS: 2 | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: install Ninja | ||
if: matrix.generator == 'Ninja' | ||
run: brew install ninja | ||
- name: choose Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.9 | ||
- name: learn Python cache directory | ||
id: pip-cache | ||
run: | | ||
sudo pip install --upgrade pip | ||
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT | ||
- name: restore Python cache directory | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.pip-cache.outputs.dir }} | ||
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/nix.yml') }} | ||
- name: install Conan | ||
run: pip install wheel 'conan<2' | ||
- name: check environment | ||
run: | | ||
echo ${PATH} | tr ':' '\n' | ||
python --version | ||
conan --version | ||
cmake --version | ||
env | ||
- name: configure Conan | ||
run: | | ||
conan profile new default --detect | ||
conan profile update settings.compiler.cppstd=20 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/nix.yml') }} | ||
- name: build | ||
uses: ./.github/actions/build | ||
with: | ||
generator: ${{ matrix.generator }} | ||
configuration: ${{ matrix.configuration }} | ||
- name: test | ||
run: | | ||
${build_dir}/rippled --unittest |
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