Skip to content

Commit

Permalink
Set up basic project workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
inxilpro committed Mar 12, 2024
1 parent b228422 commit 07e2121
Show file tree
Hide file tree
Showing 7 changed files with 252 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**What version does this affect?**
- Laravel Version: [e.g. 5.8.0]
- Package Version: [e.g. 1.5.0]

**To Reproduce**
Steps to reproduce the behavior:

**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest a new feature idea or improvement
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
48 changes: 48 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Code Coverage

on:
push:
branches:
- main

jobs:
coverage:
runs-on: ubuntu-latest

name: Publish code coverage

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, intl, iconv
coverage: pcov

- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
vendor
${{ steps.composer-cache-files-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
env:
COMPOSER_DISCARD_CHANGES: true
run: composer require --no-progress --no-interaction --prefer-dist --update-with-all-dependencies "laravel/framework:^10.0"

- name: Run and publish code coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: vendor/bin/phpunit --coverage-clover ${{ github.workspace }}/clover.xml
debug: true
coverageLocations:
"${{github.workspace}}/clover.xml:clover"
37 changes: 37 additions & 0 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Code Style

on: [ pull_request, push ]

jobs:
coverage:
runs-on: ubuntu-latest

name: Run code style checks

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, intl, iconv

- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
vendor
${{ steps.composer-cache-files-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
env:
COMPOSER_DISCARD_CHANGES: true
run: composer require --no-progress --no-interaction --prefer-dist --update-with-all-dependencies "laravel/framework:^10.0"

- name: Run PHP CS Fixer
run: ./vendor/bin/php-cs-fixer fix --diff --dry-run
60 changes: 60 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: PHPUnit

on:
push:
pull_request:
schedule:
- cron: '0 14 * * 3' # Run Wednesdays at 2pm EST

jobs:
php-tests:
runs-on: ubuntu-latest

strategy:
matrix:
php: [ 8.1, 8.2, 8.3 ]
laravel: [ ^9.0, ^10.0, ^11.0 ]
dependency-version: [ stable, lowest ]
exclude:
- laravel: ^11.0
php: 8.1
- laravel: ^9.0
dependency-version: lowest

name: "${{ matrix.php }} / ${{ matrix.laravel }} (${{ matrix.dependency-version }})"

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, intl, iconv
tools: composer:v2

- name: Register composer cache directory
id: composer-cache-files-dir
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
vendor
${{ steps.composer-cache-files-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
env:
COMPOSER_DISCARD_CHANGES: true
run: |
composer config minimum-stability ${{ matrix.minimum-stability }}
composer require --no-progress --no-interaction --prefer-dist --update-with-all-dependencies "laravel/framework:${{ matrix.laravel }}"
composer update --no-progress --no-interaction --prefer-dist --with-all-dependencies --prefer-${{ matrix.dependency-version }}
- name: Execute tests
run: vendor/bin/phpunit
27 changes: 27 additions & 0 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Update Changelog

on:
release:
types: [ published ]

jobs:
update-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
repository: ${{ github.event.repository.full_name }}
ref: 'main'

- name: Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@v1
with:
version: ${{ github.event.release.tag_name }}

- name: Commit changelog back to repo
uses: EndBug/add-and-commit@v8
with:
add: 'CHANGELOG.md'
message: ${{ github.event.release.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Changelog

All notable changes **after `0.4.1`** will be documented in this file following
the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Added Laravel 11 support
- Added basic tests

# Keep a Changelog Syntax

- `Added` for new features.
- `Changed` for changes in existing functionality.
- `Deprecated` for soon-to-be removed features.
- `Removed` for now removed features.
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

[Unreleased]: https://github.com/InterNACHI/blade-alpine-instantsearch/compare/0.4.1...HEAD

[0.4.1]: https://github.com/InterNACHI/blade-alpine-instantsearch/compare/0.4.0...0.4.1

[0.4.0]: https://github.com/InterNACHI/blade-alpine-instantsearch/compare/0.3.0...0.4.0

[0.3.0]: https://github.com/InterNACHI/blade-alpine-instantsearch/compare/0.2.0...0.3.0

[0.2.0]: https://github.com/InterNACHI/blade-alpine-instantsearch/compare/0.1.2...0.2.0

[0.1.2]: https://github.com/InterNACHI/blade-alpine-instantsearch/compare/0.1.1...0.1.2

[0.1.1]: https://github.com/InterNACHI/blade-alpine-instantsearch/compare/0.1.0...0.1.1

[0.0.1]: https://github.com/InterNACHI/blade-alpine-instantsearch/compare/0.1.0...0.1.0

0 comments on commit 07e2121

Please sign in to comment.