mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-04 11:55:51 +00:00
Updates the GitHub Actions workflow concurrency configuration to allow
parallel execution of workflows on the `develop` branch while
maintaining cancellation behavior for other branches.
## Problem
Previously, all workflow runs were subject to cancellation when new
commits were pushed to the same branch (`cancel-in-progress: true`).
This caused issues on the `develop` branch where important CI runs could
be prematurely cancelled, potentially missing critical feedback on the
main development branch.
## Solution
Modified the `concurrency` settings in `.github/workflows/build.yml` to
use separate concurrency groups and conditional cancellation:
```yaml
concurrency:
# Use separate concurrency groups for develop vs other branches to prevent cross-cancellation
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/develop' && github.run_number || 'branch' }}
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
```
## Behavior
- **`develop` branch**: Each run gets its own concurrency group (using
`run_number`), allowing parallel execution without cancellation or
queuing delays
- **All other branches**: Shared concurrency group with
`cancel-in-progress: true` - workflows are cancelled when new commits
are pushed
This ensures that the `develop` branch can run multiple workflows in
parallel without interference while still providing the efficiency
benefits of workflow cancellation on feature branches and pull requests.
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 Share your feedback on Copilot coding agent for the chance to win a
$200 gift card! Click
[here](https://survey.alchemer.com/s3/8343779/Copilot-Coding-agent) to
start the survey.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kuznetsss <15742918+kuznetsss@users.noreply.github.com>
Co-authored-by: mathbunnyru <12270691+mathbunnyru@users.noreply.github.com>
112 lines
3.0 KiB
YAML
112 lines
3.0 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [release/*, develop]
|
|
pull_request:
|
|
branches: [release/*, develop]
|
|
paths:
|
|
- .github/workflows/build.yml
|
|
|
|
- .github/workflows/build_and_test.yml
|
|
- .github/workflows/build_impl.yml
|
|
- .github/workflows/test_impl.yml
|
|
- .github/workflows/upload_coverage_report.yml
|
|
|
|
- ".github/actions/**"
|
|
- "!.github/actions/build_docker_image/**"
|
|
- "!.github/actions/create_issue/**"
|
|
|
|
- CMakeLists.txt
|
|
- conanfile.py
|
|
- conan.lock
|
|
- "cmake/**"
|
|
- "src/**"
|
|
- "tests/**"
|
|
|
|
- docs/config-description.md
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
# Develop branch: Each run gets unique group (using run_number) for parallel execution
|
|
# Other branches: Shared group with cancel-in-progress to stop old runs when new commits are pushed
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/develop' && github.run_number || 'branch' }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-and-test:
|
|
name: Build and Test
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [heavy]
|
|
conan_profile: [gcc, clang]
|
|
build_type: [Release, Debug]
|
|
container:
|
|
[
|
|
'{ "image": "ghcr.io/xrplf/clio-ci:a446d85297b3006e6d2c4dc7640368f096afecf5" }',
|
|
]
|
|
static: [true]
|
|
|
|
include:
|
|
- os: macos15
|
|
conan_profile: apple-clang
|
|
build_type: Release
|
|
container: ""
|
|
static: false
|
|
|
|
uses: ./.github/workflows/build_and_test.yml
|
|
with:
|
|
runs_on: ${{ matrix.os }}
|
|
container: ${{ matrix.container }}
|
|
conan_profile: ${{ matrix.conan_profile }}
|
|
build_type: ${{ matrix.build_type }}
|
|
static: ${{ matrix.static }}
|
|
run_unit_tests: true
|
|
run_integration_tests: false
|
|
upload_clio_server: true
|
|
|
|
code_coverage:
|
|
name: Run Code Coverage
|
|
|
|
uses: ./.github/workflows/build_impl.yml
|
|
with:
|
|
runs_on: heavy
|
|
container: '{ "image": "ghcr.io/xrplf/clio-ci:a446d85297b3006e6d2c4dc7640368f096afecf5" }'
|
|
conan_profile: gcc
|
|
build_type: Debug
|
|
disable_cache: false
|
|
code_coverage: true
|
|
static: true
|
|
upload_clio_server: false
|
|
targets: all
|
|
analyze_build_time: false
|
|
secrets:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
check_config:
|
|
name: Check Config Description
|
|
needs: build-and-test
|
|
runs-on: heavy
|
|
container:
|
|
image: ghcr.io/xrplf/clio-ci:a446d85297b3006e6d2c4dc7640368f096afecf5
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: clio_server_Linux_Release_gcc
|
|
|
|
- name: Compare Config Description
|
|
shell: bash
|
|
run: |
|
|
repoConfigFile=docs/config-description.md
|
|
configDescriptionFile=config_description_new.md
|
|
|
|
chmod +x ./clio_server
|
|
./clio_server -d "${configDescriptionFile}"
|
|
|
|
diff -u "${repoConfigFile}" "${configDescriptionFile}"
|