mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
refactor checkpatterns remove comments
This commit is contained in:
26
.github/workflows/xahau-ga-checkpatterns.yml
vendored
Normal file
26
.github/workflows/xahau-ga-checkpatterns.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
name: Nix - GA Runner
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore: ["dev", "candidate", "release"]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
checkpatterns:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Check for suspicious patterns
|
||||||
|
run: |
|
||||||
|
if [ -f "suspicious_patterns.sh" ]; then
|
||||||
|
bash suspicious_patterns.sh
|
||||||
|
else
|
||||||
|
echo "Warning: suspicious_patterns.sh not found, skipping check"
|
||||||
|
# Still exit with success for compatibility with dependent jobs
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
25
.github/workflows/xahau-ga-macos.yml
vendored
25
.github/workflows/xahau-ga-macos.yml
vendored
@@ -1,12 +1,9 @@
|
|||||||
name: MacOS - GA Runner
|
name: MacOS - GA Runner
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Use GA runners on pushes except for the branches which build by the sh runner
|
|
||||||
push:
|
push:
|
||||||
branches-ignore: ["dev", "candidate", "release"]
|
branches-ignore: ["dev", "candidate", "release"]
|
||||||
|
|
||||||
# Concurrency control: Cancels older in-progress runs for the same branch (github.ref)
|
|
||||||
# when a new push occurs. This saves runner minutes on superseded commits.
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
@@ -14,46 +11,36 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
strategy:
|
strategy:
|
||||||
# Matrix allows defining variations (e.g., different compilers, configs).
|
|
||||||
# Keys below are structured to support future matrix expansion.
|
|
||||||
matrix:
|
matrix:
|
||||||
generator:
|
generator:
|
||||||
- Ninja
|
- Ninja
|
||||||
configuration:
|
configuration:
|
||||||
- Debug
|
- Debug
|
||||||
# Use the specified macOS runner version
|
|
||||||
runs-on: macos-15
|
runs-on: macos-15
|
||||||
env:
|
env:
|
||||||
# Build directory relative to the workspace root
|
|
||||||
build_dir: .build
|
build_dir: .build
|
||||||
# Manual cache version control. Bump this number to invalidate all caches globally.
|
# Bump this number to invalidate all caches globally.
|
||||||
CACHE_VERSION: 1
|
CACHE_VERSION: 1
|
||||||
# Default branch name used for prioritizing ccache restores. Adjust if needed.
|
MAIN_BRANCH_NAME: dev
|
||||||
MAIN_BRANCH_NAME: jshooks
|
|
||||||
steps:
|
steps:
|
||||||
# 1. Checkout Code
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# 2. Install Build Dependencies via Homebrew
|
|
||||||
- name: Install Conan
|
- name: Install Conan
|
||||||
run: |
|
run: |
|
||||||
brew install conan@1
|
brew install conan@1
|
||||||
# Add Conan 1 to the PATH for this job
|
# Add Conan 1 to the PATH for this job
|
||||||
echo "$(brew --prefix conan@1)/bin" >> $GITHUB_PATH
|
echo "$(brew --prefix conan@1)/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
# 3. Install Coreutils (for 'nproc')
|
|
||||||
- name: Install Coreutils
|
- name: Install Coreutils
|
||||||
run: |
|
run: |
|
||||||
brew install coreutils
|
brew install coreutils
|
||||||
echo "Num proc: $(nproc)"
|
echo "Num proc: $(nproc)"
|
||||||
|
|
||||||
# 4. Install Ninja (if needed by generator)
|
|
||||||
- name: Install Ninja
|
- name: Install Ninja
|
||||||
if: matrix.generator == 'Ninja'
|
if: matrix.generator == 'Ninja'
|
||||||
run: brew install ninja
|
run: brew install ninja
|
||||||
|
|
||||||
# 5. Install Python (if needed)
|
|
||||||
- name: Install Python
|
- name: Install Python
|
||||||
run: |
|
run: |
|
||||||
if which python3 > /dev/null 2>&1; then
|
if which python3 > /dev/null 2>&1; then
|
||||||
@@ -67,7 +54,6 @@ jobs:
|
|||||||
sudo ln -sf $(which python3) /usr/local/bin/python
|
sudo ln -sf $(which python3) /usr/local/bin/python
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 6. Install CMake (if needed)
|
|
||||||
- name: Install CMake
|
- name: Install CMake
|
||||||
run: |
|
run: |
|
||||||
if which cmake > /dev/null 2>&1; then
|
if which cmake > /dev/null 2>&1; then
|
||||||
@@ -77,11 +63,9 @@ jobs:
|
|||||||
brew install cmake
|
brew install cmake
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 7. Install ccache
|
|
||||||
- name: Install ccache
|
- name: Install ccache
|
||||||
run: brew install ccache
|
run: brew install ccache
|
||||||
|
|
||||||
# 8. Configure ccache (add this action)
|
|
||||||
- name: Configure ccache
|
- name: Configure ccache
|
||||||
uses: ./.github/actions/xahau-configure-ccache
|
uses: ./.github/actions/xahau-configure-ccache
|
||||||
with:
|
with:
|
||||||
@@ -89,7 +73,6 @@ jobs:
|
|||||||
hash_dir: true
|
hash_dir: true
|
||||||
compiler_check: content
|
compiler_check: content
|
||||||
|
|
||||||
# 9. Environment Verification (Optional but Recommended)
|
|
||||||
- name: Check environment
|
- name: Check environment
|
||||||
run: |
|
run: |
|
||||||
echo "PATH:"
|
echo "PATH:"
|
||||||
@@ -102,13 +85,11 @@ jobs:
|
|||||||
echo "---- Full Environment ----"
|
echo "---- Full Environment ----"
|
||||||
env
|
env
|
||||||
|
|
||||||
# 10. Configure Conan Profile
|
|
||||||
- name: Configure Conan
|
- name: Configure Conan
|
||||||
run: |
|
run: |
|
||||||
conan profile new default --detect || true # Ignore error if profile exists
|
conan profile new default --detect || true # Ignore error if profile exists
|
||||||
conan profile update settings.compiler.cppstd=20 default
|
conan profile update settings.compiler.cppstd=20 default
|
||||||
|
|
||||||
# 11. Install dependencies using the action
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/xahau-ga-dependencies
|
uses: ./.github/actions/xahau-ga-dependencies
|
||||||
with:
|
with:
|
||||||
@@ -118,7 +99,6 @@ jobs:
|
|||||||
cache_version: ${{ env.CACHE_VERSION }}
|
cache_version: ${{ env.CACHE_VERSION }}
|
||||||
main_branch: ${{ env.MAIN_BRANCH_NAME }}
|
main_branch: ${{ env.MAIN_BRANCH_NAME }}
|
||||||
|
|
||||||
# 12. Build Project using the action
|
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: ./.github/actions/xahau-ga-build
|
uses: ./.github/actions/xahau-ga-build
|
||||||
with:
|
with:
|
||||||
@@ -129,7 +109,6 @@ jobs:
|
|||||||
cache_version: ${{ env.CACHE_VERSION }}
|
cache_version: ${{ env.CACHE_VERSION }}
|
||||||
main_branch: ${{ env.MAIN_BRANCH_NAME }}
|
main_branch: ${{ env.MAIN_BRANCH_NAME }}
|
||||||
|
|
||||||
# 13. Run Tests
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
${{ env.build_dir }}/rippled --unittest --unittest-jobs $(nproc)
|
${{ env.build_dir }}/rippled --unittest --unittest-jobs $(nproc)
|
||||||
70
.github/workflows/xahau-ga-nix.yml
vendored
70
.github/workflows/xahau-ga-nix.yml
vendored
@@ -1,70 +1,37 @@
|
|||||||
name: Nix - GA Runner
|
name: Nix - GA Runner
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Use GA runners on pushes except for the branches which build by the sh runner
|
|
||||||
push:
|
push:
|
||||||
branches-ignore: ["dev", "candidate", "release"]
|
branches-ignore: ["dev", "candidate", "release"]
|
||||||
|
|
||||||
# Concurrency control: Cancels older in-progress runs for the same branch (github.ref)
|
|
||||||
# when a new push occurs. This saves runner minutes on superseded commits.
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# 1. Initial Check Job (Optional Sanity Check)
|
|
||||||
checkpatterns:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Check for suspicious patterns
|
|
||||||
run: |
|
|
||||||
if [ -f "suspicious_patterns.sh" ]; then
|
|
||||||
bash suspicious_patterns.sh
|
|
||||||
else
|
|
||||||
echo "Warning: suspicious_patterns.sh not found, skipping check"
|
|
||||||
# Still exit with success for compatibility with dependent jobs
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 2. Main Build Job
|
|
||||||
build-job:
|
build-job:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: checkpatterns # Depends on the initial check passing
|
|
||||||
outputs:
|
outputs:
|
||||||
# Output artifact name for potential downstream use
|
|
||||||
artifact_name: ${{ steps.set-artifact-name.outputs.artifact_name }}
|
artifact_name: ${{ steps.set-artifact-name.outputs.artifact_name }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
# Matrix defines build variations. Keys are structured for this.
|
|
||||||
matrix:
|
matrix:
|
||||||
compiler: [gcc] # Example: Add 'clang' here later
|
compiler: [gcc]
|
||||||
configuration: [Debug] # Example: Add 'Release' here later
|
configuration: [Debug]
|
||||||
include:
|
include:
|
||||||
# Link compiler matrix variable to specific package names/paths
|
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
cc: gcc-11
|
cc: gcc-11
|
||||||
cxx: g++-11
|
cxx: g++-11
|
||||||
compiler_id: gcc-11
|
compiler_id: gcc-11
|
||||||
# - compiler: clang
|
|
||||||
# cc: clang-14
|
|
||||||
# cxx: clang++-14
|
|
||||||
# compiler_id: clang-14
|
|
||||||
env:
|
env:
|
||||||
# Build directory relative to the workspace root
|
|
||||||
build_dir: .build
|
build_dir: .build
|
||||||
# Manual cache version control. Bump this number to invalidate all caches globally.
|
# Bump this number to invalidate all caches globally.
|
||||||
CACHE_VERSION: 1
|
CACHE_VERSION: 1
|
||||||
# Default branch name used for prioritizing ccache restores. Adjust if needed.
|
MAIN_BRANCH_NAME: dev
|
||||||
MAIN_BRANCH_NAME: jshooks
|
|
||||||
steps:
|
steps:
|
||||||
# 2.1. Checkout Code
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# 2.2. Install Build System Dependencies (apt)
|
|
||||||
- name: Install build dependencies
|
- name: Install build dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
@@ -72,7 +39,6 @@ jobs:
|
|||||||
# Install specific Conan version needed
|
# Install specific Conan version needed
|
||||||
pip install --upgrade "conan<2"
|
pip install --upgrade "conan<2"
|
||||||
|
|
||||||
# 2.3. Configure ccache
|
|
||||||
- name: Configure ccache
|
- name: Configure ccache
|
||||||
uses: ./.github/actions/xahau-configure-ccache
|
uses: ./.github/actions/xahau-configure-ccache
|
||||||
with:
|
with:
|
||||||
@@ -80,8 +46,6 @@ jobs:
|
|||||||
hash_dir: true
|
hash_dir: true
|
||||||
compiler_check: content
|
compiler_check: content
|
||||||
|
|
||||||
# 2.4. Configure Conan Profile
|
|
||||||
# Sets up the Conan profile specifically for the compiler specified in the matrix.
|
|
||||||
- name: Configure Conan
|
- name: Configure Conan
|
||||||
run: |
|
run: |
|
||||||
conan profile new default --detect || true # Ignore error if profile exists
|
conan profile new default --detect || true # Ignore error if profile exists
|
||||||
@@ -101,7 +65,6 @@ jobs:
|
|||||||
# Display profile for verification
|
# Display profile for verification
|
||||||
conan profile show default
|
conan profile show default
|
||||||
|
|
||||||
# 2.5. Environment Verification (Optional but Recommended)
|
|
||||||
- name: Check environment
|
- name: Check environment
|
||||||
run: |
|
run: |
|
||||||
echo "PATH:"
|
echo "PATH:"
|
||||||
@@ -114,7 +77,6 @@ jobs:
|
|||||||
echo "---- Full Environment ----"
|
echo "---- Full Environment ----"
|
||||||
env
|
env
|
||||||
|
|
||||||
# 2.6. Install Dependencies using the action
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/xahau-ga-dependencies
|
uses: ./.github/actions/xahau-ga-dependencies
|
||||||
with:
|
with:
|
||||||
@@ -124,7 +86,6 @@ jobs:
|
|||||||
cache_version: ${{ env.CACHE_VERSION }}
|
cache_version: ${{ env.CACHE_VERSION }}
|
||||||
main_branch: ${{ env.MAIN_BRANCH_NAME }}
|
main_branch: ${{ env.MAIN_BRANCH_NAME }}
|
||||||
|
|
||||||
# 2.7. Build Project using the action
|
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: ./.github/actions/xahau-ga-build
|
uses: ./.github/actions/xahau-ga-build
|
||||||
with:
|
with:
|
||||||
@@ -137,7 +98,6 @@ jobs:
|
|||||||
cache_version: ${{ env.CACHE_VERSION }}
|
cache_version: ${{ env.CACHE_VERSION }}
|
||||||
main_branch: ${{ env.MAIN_BRANCH_NAME }}
|
main_branch: ${{ env.MAIN_BRANCH_NAME }}
|
||||||
|
|
||||||
# 2.8. Set Artifact Name (Based on Matrix)
|
|
||||||
- name: Set artifact name
|
- name: Set artifact name
|
||||||
id: set-artifact-name
|
id: set-artifact-name
|
||||||
run: |
|
run: |
|
||||||
@@ -145,13 +105,11 @@ jobs:
|
|||||||
echo "artifact_name=${ARTIFACT_NAME}" >> "$GITHUB_OUTPUT"
|
echo "artifact_name=${ARTIFACT_NAME}" >> "$GITHUB_OUTPUT"
|
||||||
echo "Using artifact name: ${ARTIFACT_NAME}"
|
echo "Using artifact name: ${ARTIFACT_NAME}"
|
||||||
|
|
||||||
# 2.9. Debug Build Directory Contents (Optional)
|
|
||||||
- name: Debug build directory
|
- name: Debug build directory
|
||||||
run: |
|
run: |
|
||||||
echo "Checking build directory contents: ${{ env.build_dir }}"
|
echo "Checking build directory contents: ${{ env.build_dir }}"
|
||||||
ls -la ${{ env.build_dir }} || echo "Build directory not found or empty"
|
ls -la ${{ env.build_dir }} || echo "Build directory not found or empty"
|
||||||
|
|
||||||
# 2.10. Run Tests
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
# Ensure the binary exists before trying to run
|
# Ensure the binary exists before trying to run
|
||||||
@@ -161,23 +119,3 @@ jobs:
|
|||||||
echo "Error: rippled executable not found in ${{ env.build_dir }}"
|
echo "Error: rippled executable not found in ${{ env.build_dir }}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# These are just here to conform with configured requirements
|
|
||||||
|
|
||||||
# 3. Dummy Downstream Job (Build)
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: build-job # Depends on the matrix build finishing
|
|
||||||
steps:
|
|
||||||
- name: Dummy Build
|
|
||||||
run: |
|
|
||||||
echo "Dummy build step - relies upon build-job matrix completion."
|
|
||||||
|
|
||||||
# 4. Dummy Downstream Job (Tests)
|
|
||||||
tests:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: build-job # Depends on the matrix build finishing
|
|
||||||
steps:
|
|
||||||
- name: Dummy Tests
|
|
||||||
run: |
|
|
||||||
echo "Dummy tests step - relies upon build-job matrix completion."
|
|
||||||
Reference in New Issue
Block a user