Skip to content

Commit

Permalink
Fix workflows (XRPLF#4948)
Browse files Browse the repository at this point in the history
The problem was `CONAN_USERNAME` environment variable, which Conan 1.x uses as the default user in package references.
  • Loading branch information
thejohnfreeman authored and mvadari committed Mar 27, 2024
1 parent ae4ecd5 commit a06a4c9
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 28 deletions.
19 changes: 14 additions & 5 deletions .github/actions/dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,25 @@ runs:
conan export external/snappy snappy/1.1.10@
conan export external/rocksdb rocksdb/6.29.5@
conan export external/soci soci/4.0.3@
- name: try to authenticate to ripple Conan remote
id: remote
- name: add Ripple Conan remote
shell: bash
run: |
conan remote list
conan remote remove ripple || true
# 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
echo outcome=$(conan user --remote ripple ${{ env.CONAN_USERNAME }} \
--password ${{ env.CONAN_TOKEN }} >&2 && echo success || \
echo failure) | tee ${GITHUB_OUTPUT}
- name: try to authenticate to Ripple Conan remote
id: remote
shell: bash
run: |
# `conan user` implicitly uses the environment variables
# CONAN_LOGIN_USERNAME_<REMOTE> and CONAN_PASSWORD_<REMOTE>.
# https://docs.conan.io/1/reference/commands/misc/user.html#using-environment-variables
# https://docs.conan.io/1/reference/env_vars.html#conan-login-username-conan-login-username-remote-name
# https://docs.conan.io/1/reference/env_vars.html#conan-password-conan-password-remote-name
echo outcome=$(conan user --remote ripple --password >&2 \
&& echo success || echo failure) | tee ${GITHUB_OUTPUT}
- name: list missing binaries
id: binaries
shell: bash
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,27 @@ jobs:
NUM_PROCESSORS: 12
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: install Ninja
if: matrix.generator == 'Ninja'
run: brew install ninja
- name: check environment
run: |
env | sort
echo ${PATH} | tr ':' '\n'
python --version
conan --version
cmake --version
env | sort
- name: configure Conan
run : |
conan profile get env.CXXFLAGS default || true
conan profile update 'conf.tools.build:cxxflags+=["-DBOOST_ASIO_DISABLE_CONCEPTS"]' default
conan remote remove ripple
- name: build dependencies
uses: ./.github/actions/dependencies
env:
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
CONAN_USERNAME: ${{ secrets.CONAN_USERNAME }}
CONAN_TOKEN: ${{ secrets.CONAN_TOKEN }}
CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }}
CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }}
with:
configuration: ${{ matrix.configuration }}
- name: build
Expand Down
23 changes: 11 additions & 12 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
build_dir: .build
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: check environment
run: |
echo ${PATH} | tr ':' '\n'
Expand All @@ -78,12 +78,12 @@ jobs:
uses: ./.github/actions/dependencies
env:
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
CONAN_USERNAME: ${{ secrets.CONAN_USERNAME }}
CONAN_TOKEN: ${{ secrets.CONAN_TOKEN }}
CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }}
CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }}
with:
configuration: ${{ matrix.configuration }}
- name: upload archive
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }}
path: conan.tar
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
build_dir: .build
steps:
- name: download cache
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }}
- name: extract cache
Expand All @@ -121,13 +121,12 @@ jobs:
tar -xzf conan.tar -C ~/.conan
- name: check environment
run: |
env | sort
echo ${PATH} | tr ':' '\n'
conan --version
cmake --version
env | sort
ls ~/.conan
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: dependencies
uses: ./.github/actions/dependencies
env:
Expand Down Expand Up @@ -162,7 +161,7 @@ jobs:
build_dir: .build
steps:
- name: download cache
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }}
- name: extract cache
Expand All @@ -178,7 +177,7 @@ jobs:
env | sort
ls ~/.conan
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: dependencies
uses: ./.github/actions/dependencies
env:
Expand All @@ -202,15 +201,15 @@ jobs:
run: |
mv "${build_dir}/coverage.xml" ./
- name: archive coverage report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage.xml
path: coverage.xml
retention-days: 30
- name: upload coverage report
uses: wandalen/[email protected]
with:
action: codecov/codecov-action@v3
action: codecov/codecov-action@v4
with: |
files: coverage.xml
fail_ci_if_error: true
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
build_dir: .build
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: choose Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: learn Python cache directory
Expand All @@ -39,19 +39,19 @@ jobs:
python -m pip install --upgrade pip
echo "dir=$(pip cache dir)" | tee ${GITHUB_OUTPUT}
- name: restore Python cache directory
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/windows.yml') }}
- name: install Conan
run: pip install wheel 'conan<2'
- name: check environment
run: |
dir env:
$env:PATH -split ';'
python --version
conan --version
cmake --version
dir env:
- name: configure Conan
shell: bash
run: |
Expand All @@ -61,8 +61,8 @@ jobs:
uses: ./.github/actions/dependencies
env:
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
CONAN_USERNAME: ${{ secrets.CONAN_USERNAME }}
CONAN_TOKEN: ${{ secrets.CONAN_TOKEN }}
CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }}
CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }}
with:
configuration: ${{ matrix.configuration }}
- name: build
Expand Down

0 comments on commit a06a4c9

Please sign in to comment.