Skip to content

Conversation

Copy link

Copilot AI commented Dec 11, 2025

The C/C++ workflow unconditionally ran ./configure on all commits, failing when only Python files changed (configure script doesn't exist). This blocked Python-only PRs.

Changes

  • Added .github/workflows/python-package.yml

    • Triggers only on trinity_wallet_py/** changes
    • Runs pytest with dependency caching
  • Updated .github/workflows/c-cpp.yml

    • Path filter: src/**, Makefile, trinity-qt.pro, contrib/**, doc/**
    • Guard configure execution: skips if ./configure not present

Result

Python and C/C++ changes now trigger only their respective workflows, preventing spurious failures.

Reference: Failing job | Original workflow

Original prompt

Create a pull request that adds a Python-specific GitHub Actions workflow for the Python package trinity_wallet_py and updates the existing C/C++ workflow so it no longer runs for Python-only changes and guards the configure step. Do not modify any other files.

Context and rationale:

Requested changes (apply in a single branch named ci/add-python-workflow-and-guard-cpp):

  1. Add new file: .github/workflows/python-package.yml

Add this exact YAML content (verbatim):

name: Python package CI

on:
push:
branches: [ "master" ]
paths:
- "trinity_wallet_py/"
pull_request:
branches: [ "master" ]
paths:
- "trinity_wallet_py/
"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('trinity_wallet_py/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f trinity_wallet_py/requirements.txt ]; then
pip install -r trinity_wallet_py/requirements.txt
fi
- name: Run tests
run: |
python -m pip install pytest || true
pytest -q trinity_wallet_py/test_wallet.py

  1. Replace existing file: .github/workflows/c-cpp.yml

Replace with this exact YAML content (verbatim). This update adds path filters to only trigger on C/C++-related changes and adds a guard around the configure invocation so it won't fail if configure is missing.

name: C/C++ CI

on:
push:
branches: [ "master" ]
paths:
- 'src/'
- 'Makefile'
- 'trinity-qt.pro'
- 'contrib/
'
- 'doc/'
- '.github/workflows/c-cpp.yml'
pull_request:
branches: [ "master" ]
paths:
- 'src/
'
- 'Makefile'
- 'trinity-qt.pro'
- 'contrib/'
- 'doc/
'
- '.github/workflows/c-cpp.yml'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: configure
run: |
if [ -x ./configure ]; then
./configure
else
echo "No configure script found; skipping configure step."
fi
- name: make
run: make
- name: make check
run: make check
- name: make distcheck
run: make distcheck

Branch and PR metadata:

Sanity and wellness checks to perform before merging:

  • Confirm both workflow files are valid YAML and syntactically correct.
  • Run a quick lint: ensure no tabs, indentation is spaces.
  • Ensure python-package.yml references trinity_wallet_py/requirements.txt and trinity_wallet_py/test_wallet.py which exist in the repo.
  • Ensure c-cpp.yml path filters include the main C/C++ build files (Makefile, src/, trinity-qt.pro).

Access and ping checks:

  • Verify repository owner is Action-Committee and repo is Trinity_py.
  • Confirm that the authenticated bot/token has push and PR merge rights on Action-Committee/Trinity_py.
  • Ping the GitHub API to ensure repository is reachable and accept the push/PR operations.

Do NOT modify any other files. After creating the PR, wait for the workflows and checks to complete, then merge the PR if checks pass and delete the branch.

This pull request was created as a result of the following prompt from Copilot chat.

Create a pull request that adds a Python-specific GitHub Actions workflow for the Python package trinity_wallet_py and updates the existing C/C++ workflow so it no longer runs for Python-only changes and guards the configure step. Do not modify any other files.

Context and rationale:

Requested changes (apply in a single branch named ci/add-python-workflow-and-guard-cpp):

  1. Add new file: .github/workflows/python-package.yml

Add this exact YAML content (verbatim):

name: Python package CI

on:
push:
branches: [ "master" ]
paths:
- "trinity_wallet_py/"
pull_request:
branches: [ "master" ]
paths:
- "trinity_wallet_py/
"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('trinity_wallet_py/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f trinity_wallet_py/requirements.txt ]; then
pip install -r trinity_wallet_py/requirements.txt
fi
- name: Run tests
run: |
python -m pip install pytest || true
pytest -q trinity_wallet_py/test_wallet.py

  1. Replace existing file: .github/workflows/c-cpp.yml

Replace with this exact YAML content (verbatim). This update adds path filters to only trigger on C/C++-related changes and adds a guard around the configure invocation so it won't fail if configure is missing.

name: C/C++ CI

on:
push:
branches: [ "master" ]
paths:
- 'src/'
- 'Makefile'
- 'trinity-qt.pro'
- 'contrib/
'
- 'doc/'
- '.github/workflows/c-cpp.yml'
pull_request:
branches: [ "master" ]
paths:
- 'src/
'
- 'Makefile'
- 'trinity-qt.pro'
- 'contrib/'
- 'doc/
'
- '.github/workflows/c-cpp.yml'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: configure
run: |
if [ -x ./configure ]; then
./configure
else
echo "No configure script found; skipping configure step."
fi
- name: make
run: make
- name: make check
run: make check
- name: make distcheck
run: make distcheck

Branch and PR metadata:

Sanity and wellness checks to perform before merging:

  • Confirm both workflow files are valid YAML and syntactically correct.
  • Run a quick lint: ensure no tabs, indentation is spaces.
  • Ensure python-package.yml references trinity_wallet_py/requirements.txt and trinity_wallet_py/test_wallet.py which exist in the repo.
  • Ensure c-cpp.yml path filters include the main C/C++ build files (Makefile, src/, trinity-qt.pro).

Access and ping checks:

  • Verify repository owner is Action-Committee and repo is Trinity_py.
  • Confirm that the authenticated bot/token has push and PR merge rights on Action-Committee/Trinity_py.
  • Ping the GitHub API to ensure repository is reachable and accept the push/PR operations.

Do NOT modify any other files. After creating the PR, wait for the workflows and checks to complete, then merge the PR if checks pass and delete the branch.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: 5mil <4460242+5mil@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Python CI workflow and update C/C++ workflow Add Python CI workflow and restrict C/C++ workflow to prevent cross-triggering Dec 11, 2025
Copilot AI requested a review from 5mil December 11, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants