mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 09:17:57 +00:00
refactor: Revamp CI workflows (#5661)
This change refactors the CI workflows to leverage the new CI Docker images for Debian, Red Hat, and Ubuntu.
This commit is contained in:
133
.github/workflows/on-pr.yml
vendored
Normal file
133
.github/workflows/on-pr.yml
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
# This workflow runs all workflows to check, build and test the project on
|
||||
# various Linux flavors, as well as on MacOS and Windows, on every push to a
|
||||
# user branch. However, it will not run if the pull request is a draft unless it
|
||||
# has the 'DraftRunCI' label.
|
||||
name: PR
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/actions/build-deps/**'
|
||||
- '.github/actions/build-test/**'
|
||||
- '.github/scripts/levelization/**'
|
||||
- '.github/scripts/strategy-matrix/**'
|
||||
- '.github/workflows/build-test.yml'
|
||||
- '.github/workflows/check-format.yml'
|
||||
- '.github/workflows/check-levelization.yml'
|
||||
- '.github/workflows/notify-clio.yml'
|
||||
- '.github/workflows/on-pr.yml'
|
||||
# Keep the list of paths below in sync with those in the `on-trigger.yml`
|
||||
# file.
|
||||
- 'cmake/**'
|
||||
- 'conan/**'
|
||||
- 'external/**'
|
||||
- 'include/**'
|
||||
- 'src/**'
|
||||
- 'tests/**'
|
||||
- '.clang-format'
|
||||
- '.codecov.yml'
|
||||
- '.pre-commit-config.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'conanfile.py'
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- labeled
|
||||
- unlabeled
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
env:
|
||||
CONAN_REMOTE_NAME: xrplf
|
||||
CONAN_REMOTE_URL: https://conan.ripplex.io
|
||||
|
||||
jobs:
|
||||
# This job determines whether the workflow should run. It runs when:
|
||||
# * Opened as a non-draft PR.
|
||||
# * A commit is added to a non-draft PR or the PR has the 'DraftRunCI' label.
|
||||
# * A draft PR has the 'DraftRunCI' label added.
|
||||
# * A non-draft PR has the 'DraftRunCI' label removed.
|
||||
# These checks are in part to ensure the workflow won't run needlessly while
|
||||
# also allowing it to be triggered without having to add a no-op commit. A new
|
||||
# workflow execution can be triggered by adding and then removing the label on
|
||||
# a non-draft PR, or conversely by removing it and then adding it back on a
|
||||
# draft PR; this can be useful in certain cases.
|
||||
should-run:
|
||||
if: >-
|
||||
${{
|
||||
(github.event.action == 'opened' && !github.event.pull_request.draft) ||
|
||||
(github.event.action == 'synchronize' && (!github.event.pull_request.draft || contains(github.event.pull_request.labels.*.name, 'DraftRunCI'))) ||
|
||||
(github.event.action == 'labeled' && github.event.pull_request.draft && github.event.label.name == 'DraftRunCI') ||
|
||||
(github.event.action == 'unlabeled' && !github.event.pull_request.draft && github.event.label.name == 'DraftRunCI')
|
||||
}}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: No-op
|
||||
run: echo ''
|
||||
|
||||
check-clang-format:
|
||||
needs: should-run
|
||||
uses: ./.github/workflows/check-format.yml
|
||||
|
||||
check-levelization:
|
||||
needs: should-run
|
||||
uses: ./.github/workflows/check-levelization.yml
|
||||
|
||||
# This job works around the limitation that GitHub Actions does not support
|
||||
# using environment variables as inputs for reusable workflows.
|
||||
generate-outputs:
|
||||
needs: should-run
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: No-op
|
||||
run: echo ''
|
||||
outputs:
|
||||
conan_remote_name: ${{ env.CONAN_REMOTE_NAME }}
|
||||
conan_remote_url: ${{ env.CONAN_REMOTE_URL }}
|
||||
|
||||
build-linux:
|
||||
needs: generate-outputs
|
||||
uses: ./.github/workflows/build-test.yml
|
||||
with:
|
||||
conan_remote_name: ${{ needs.generate-outputs.outputs.conan_remote_name }}
|
||||
conan_remote_url: ${{ needs.generate-outputs.outputs.conan_remote_url }}
|
||||
os: 'linux'
|
||||
secrets:
|
||||
codecov_token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
build-macos:
|
||||
needs: generate-outputs
|
||||
uses: ./.github/workflows/build-test.yml
|
||||
with:
|
||||
conan_remote_name: ${{ needs.generate-outputs.outputs.conan_remote_name }}
|
||||
conan_remote_url: ${{ needs.generate-outputs.outputs.conan_remote_url }}
|
||||
os: 'macos'
|
||||
|
||||
build-windows:
|
||||
needs: generate-outputs
|
||||
uses: ./.github/workflows/build-test.yml
|
||||
with:
|
||||
conan_remote_name: ${{ needs.generate-outputs.outputs.conan_remote_name }}
|
||||
conan_remote_url: ${{ needs.generate-outputs.outputs.conan_remote_url }}
|
||||
os: 'windows'
|
||||
|
||||
notify-clio:
|
||||
needs:
|
||||
- generate-outputs
|
||||
- build-linux
|
||||
- build-macos
|
||||
- build-windows
|
||||
uses: ./.github/workflows/notify-clio.yml
|
||||
with:
|
||||
conan_remote_name: ${{ needs.generate-outputs.outputs.conan_remote_name }}
|
||||
conan_remote_url: ${{ needs.generate-outputs.outputs.conan_remote_url }}
|
||||
secrets:
|
||||
clio_notify_token: ${{ secrets.CLIO_NOTIFY_TOKEN }}
|
||||
conan_remote_username: ${{ secrets.CONAN_REMOTE_USERNAME }}
|
||||
conan_remote_password: ${{ secrets.CONAN_REMOTE_PASSWORD }}
|
||||
Reference in New Issue
Block a user