Skip to content

Fix GitHub Actions workflows for reliable CI/CD#6

Merged
alhia merged 2 commits intomainfrom
refactor/bind-transport-and-release-workflow
Mar 17, 2026
Merged

Fix GitHub Actions workflows for reliable CI/CD#6
alhia merged 2 commits intomainfrom
refactor/bind-transport-and-release-workflow

Conversation

@alhia
Copy link
Collaborator

@alhia alhia commented Mar 17, 2026

Fix deprecated GitHub Actions and improve CI/CD reliability.

Key changes:

  • Remove deprecated github/copilot-models action
  • Fix invalid permissions
  • Add proper error handling for dependencies
  • Create new CI workflow for PR testing
  • Add validation for builds and version updates
  • Improve logging and debugging output

This makes the release workflow more reliable and adds early testing for PRs.

- Fix deprecated github/copilot-models action in release workflow
- Remove deprecated 'models: read' permission
- Add proper error handling and validation for dependency installation
- Make test execution conditional when tests don't exist
- Add build artifact validation before PyPI publishing
- Create separate CI workflow for PR testing with matrix builds
- Improve logging and debugging output throughout workflows
Copilot AI review requested due to automatic review settings March 17, 2026 12:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the deprecated github/copilot-models action (which was used to auto-detect version bump type via an LLM) and replaces it with a simple default-to-patch fallback. It also adds a new CI workflow for PR testing and improves the release workflow with better logging, error handling, and build validation.

Changes:

  • Replace the github/copilot-models action with a deterministic patch-default fallback and remove the invalid models: read permission
  • Add verbose logging, build artifact validation, and version update verification to the release workflow
  • Create a new ci.yml workflow that runs tests, build checks, import validation, and pyproject.toml validation on PRs and pushes to main

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
.github/workflows/release.yml Removes deprecated Copilot models action, adds logging/validation, improves error handling for dependency install, tests, build, and version update steps
.github/workflows/ci.yml New CI workflow with test matrix (Python 3.12/3.13), build check, import validation, and pyproject.toml validation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +164 to +168
if [ -d "tests" ] && [ "$(ls -A tests/*.py 2>/dev/null)" ]; then
echo "Running tests..."
python -m pytest tests/ -v
else
echo "No tests found, skipping test step"
Comment on lines +32 to +36
if [ -d "tests" ] && [ "$(ls -A tests/*.py 2>/dev/null)" ]; then
echo "Running tests..."
python -m pytest tests/ -v
else
echo "No tests found, skipping test step"

- name: Validate pyproject.toml
run: |
pip install tomli-w
Comment on lines +4 to +75
pull_request:
branches: [main]
push:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.13"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install --upgrade pip
pip install -e .
pip install pytest

- name: Run tests
run: |
if [ -d "tests" ] && [ "$(ls -A tests/*.py 2>/dev/null)" ]; then
echo "Running tests..."
python -m pytest tests/ -v
else
echo "No tests found, skipping test step"
fi

- name: Check package can be built
run: |
pip install build
python -m build
echo "Package built successfully"

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
pip install --upgrade pip
pip install -e .

- name: Check imports
run: |
echo "Testing basic import..."
python -c "import pyflic_ble; print('Import successful')"

- name: Validate pyproject.toml
run: |
pip install tomli-w
python -c "
import tomllib
with open('pyproject.toml', 'rb') as f:
data = tomllib.load(f)
print('pyproject.toml is valid')
print(f'Project: {data[\"project\"][\"name\"]} v{data[\"project\"][\"version\"]}')
"
Keep the better fix that removes deprecated github/copilot-models action entirely
rather than trying to update to @latest (which is also non-functional).
The simple fallback to patch bump is more reliable.
@alhia alhia merged commit ffb33a8 into main Mar 17, 2026
3 checks passed
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