Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: align with CI workflows of other interface packages #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/conventional-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: PR
on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize

jobs:
title-format:
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64 changes: 64 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
on:
push:
branches:
- main

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: release
with:
release-type: simple
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Update release-type for Python package.

The release-type should be set to "python" instead of "simple" for Python packages to ensure proper version management and changelog generation.

-          release-type: simple
+          release-type: python
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
release-type: simple
release-type: python


Comment on lines +8 to +18
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

🛠️ Refactor suggestion

Update the release-type Parameter to "python" for Python Packages

The GitHub Actions workflow in .github/workflows/release-please.yml currently sets the parameter as release-type: simple. Since this repository is a Python package (as evidenced by the use of Python setup, Poetry, and PyPI publishing steps), the parameter should be updated to "python" for correct version management, changelog generation, and proper PyPI integration.

  • File: .github/workflows/release-please.yml
  • Location: Under the release-please job, change lines where release-type: simple is specified.
  • Proposed Change:
    -          release-type: simple
    +          release-type: python
🔗 Analysis chain

Update the Release Type Parameter

The release-please job uses GoogleCloudPlatform/release-please-action@v3 with the parameter release-type set to "simple". For Python packages, this value should be updated to "python" to ensure proper version management, changelog generation, and integration with PyPI publishing.

-          release-type: simple
+          release-type: python
🏁 Scripts executed

The following scripts were executed for the analysis:

Error: No shell scripts found


Script:

#!/bin/bash
# Display the contents of the GitHub Actions workflow file to verify the release-type parameter.
cat .github/workflows/release-please.yml

Length of output: 1525

setup_and_build:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 2.0.0

- name: Install dependencies
run: poetry install --with dev

- name: Build source and wheel distribution
run: |
poetry build

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
pypi_publish:
name: Upload release to PyPI
needs: [release-please, setup_and_build]
runs-on: ubuntu-latest
environment:
name: release
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: dist
path: dist/

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
137 changes: 0 additions & 137 deletions .github/workflows/release.yml

This file was deleted.

75 changes: 75 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches-ignore: []
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove empty branches-ignore section.

The empty branches-ignore section is unnecessary and can be removed.

  pull_request:
-   branches-ignore: []
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
branches-ignore: []
pull_request:
🧰 Tools
🪛 actionlint (1.7.4)

8-8: "branches-ignore" section should not be empty

(syntax-check)


jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 2.0.0

- name: Install dependencies
run: poetry install --with dev

- name: Check formatting
run: poetry run ruff format --check

linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 2.0.0

- name: Install dependencies
run: poetry install --with dev

- name: Check code
run: poetry run ruff check

testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 2.0.0

- name: Install dependencies
run: poetry install --with dev

- name: Run pytest
run: poetry run coverage run -m pytest tests/tests.py

- name: Run Coverage
run: poetry run coverage report -m
Loading