mirror of
https://github.com/manualdousuario/marreta.git
synced 2026-10-16 11:55:03 +00:00
new ci rls
This commit is contained in:
parent
3e38f454fc
commit
daf17f4064
2 changed files with 68 additions and 33 deletions
57
.github/workflows/ci.yml
vendored
Normal file
57
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
name: ✅ CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
workflow_call: {}
|
||||
|
||||
jobs:
|
||||
php-lint:
|
||||
name: 🔍 PHP syntax check
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: 🐘 Install PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.4'
|
||||
tools: none
|
||||
|
||||
- name: 🔍 Validate PHP syntax
|
||||
run: git ls-files | grep '\.php$' | xargs -P4 -I{} php -l {}
|
||||
|
||||
tests:
|
||||
name: 🧪 Run tests
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: 🐘 Install PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.4'
|
||||
extensions: intl, sockets, sqlite3, pdo_sqlite
|
||||
coverage: none
|
||||
|
||||
- name: 📦 Install dependencies
|
||||
run: composer install --no-interaction --prefer-dist --no-progress
|
||||
|
||||
- name: 🛡️ Audit dependencies
|
||||
run: composer audit
|
||||
|
||||
- name: 🎨 Check code style
|
||||
run: vendor/bin/pint --test
|
||||
|
||||
- name: 🧰 Prepare environment
|
||||
run: |
|
||||
cp .env.example .env
|
||||
php artisan key:generate
|
||||
|
||||
- name: 🧪 Run test suite
|
||||
run: php artisan test
|
||||
44
.github/workflows/release.yml
vendored
44
.github/workflows/release.yml
vendored
|
|
@ -12,40 +12,14 @@ env:
|
|||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
php-lint:
|
||||
name: 🔍 PHP syntax check
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: 🐘 Install PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.4'
|
||||
tools: none
|
||||
|
||||
- name: 🔍 Validate PHP syntax
|
||||
run: |
|
||||
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
||||
if [ -z "$PREVIOUS_TAG" ]; then
|
||||
FILES=$(git ls-files | grep '\.php$' || true)
|
||||
else
|
||||
FILES=$(git diff --name-only --diff-filter=d "$PREVIOUS_TAG"..HEAD | grep '\.php$' || true)
|
||||
fi
|
||||
if [ -z "$FILES" ]; then
|
||||
echo "No PHP files changed since last tag."
|
||||
exit 0
|
||||
fi
|
||||
echo "$FILES" | xargs -P4 -I{} php -l {}
|
||||
ci:
|
||||
name: ✅ CI
|
||||
uses: ./.github/workflows/ci.yml
|
||||
|
||||
setup:
|
||||
name: 🔍 Extract version
|
||||
runs-on: ubuntu-24.04
|
||||
needs: [php-lint]
|
||||
needs: [ci]
|
||||
outputs:
|
||||
version: ${{ steps.get_version.outputs.VERSION }}
|
||||
prerelease: ${{ steps.get_version.outputs.PRERELEASE }}
|
||||
|
|
@ -195,13 +169,17 @@ jobs:
|
|||
|
||||
- name: 🤖 Generate release notes
|
||||
id: ai_notes
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
RELEASE_VERSION: ${{ needs.setup.outputs.version }}
|
||||
COMMIT_LOG: ${{ steps.commits.outputs.LOG }}
|
||||
run: |
|
||||
RESPONSE=$(curl -s https://models.inference.ai.azure.com/chat/completions \
|
||||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Authorization: Bearer $GH_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$(jq -n \
|
||||
--arg version "${{ needs.setup.outputs.version }}" \
|
||||
--arg log "${{ steps.commits.outputs.LOG }}" \
|
||||
--arg version "$RELEASE_VERSION" \
|
||||
--arg log "$COMMIT_LOG" \
|
||||
'{
|
||||
model: "gpt-4o-mini",
|
||||
messages: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue