Skip to content

Commit b19fe81

Browse files
authored
ADD: github actions (#63)
* ADD: github actions * Fix styling --------- Co-authored-by: pixelpeter <[email protected]>
1 parent d89e5c5 commit b19fe81

18 files changed

+293
-97
lines changed

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Please see the documentation for all configuration options:
2+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"
11+
labels:
12+
- "dependencies"
13+
14+
- package-ecosystem: composer
15+
directory: "/"
16+
schedule:
17+
interval: daily
18+
time: "04:00"
19+
open-pull-requests-limit: 10
20+
labels:
21+
- "dependencies"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Dependabot auto merge
2+
on: pull_request_target
3+
4+
permissions:
5+
pull-requests: write
6+
contents: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.actor == 'dependabot[bot]' }}
12+
steps:
13+
14+
- name: Dependabot metadata
15+
id: metadata
16+
uses: dependabot/[email protected]
17+
with:
18+
github-token: "${{ secrets.GITHUB_TOKEN }}"
19+
20+
- name: Auto-merge Dependabot PRs for semver-minor updates
21+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
22+
run: gh pr merge --auto --merge "$PR_URL"
23+
env:
24+
PR_URL: ${{github.event.pull_request.html_url}}
25+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
26+
27+
- name: Auto-merge Dependabot PRs for semver-patch updates
28+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
29+
run: gh pr merge --auto --merge "$PR_URL"
30+
env:
31+
PR_URL: ${{github.event.pull_request.html_url}}
32+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Fix PHP code style issues
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
php-code-styling:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.head_ref }}
20+
21+
- name: Fix PHP code style issues
22+
uses: aglipanci/[email protected]
23+
24+
- name: Commit changes
25+
uses: stefanzweifel/git-auto-commit-action@v5
26+
with:
27+
commit_message: Fix styling

.github/workflows/phpstan.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: PHPStan
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'phpstan.neon.dist'
8+
- '.github/workflows/phpstan.yml'
9+
10+
jobs:
11+
phpstan:
12+
name: phpstan
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: '7.4'
21+
coverage: none
22+
23+
- name: Install composer dependencies
24+
uses: ramsey/composer-install@v3
25+
26+
- name: Run PHPStan
27+
run: ./vendor/bin/phpstan --error-format=github

.github/workflows/run-tests.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: true
14+
matrix:
15+
os: [ ubuntu-latest ]
16+
php: [ 7.4, 7.3 ]
17+
laravel: [ 7.*, 6.*, 5.8.* ]
18+
stability: [ prefer-stable ]
19+
include:
20+
- laravel: 7.*
21+
testbench: 5.*
22+
carbon: 2.*
23+
- laravel: 6.*
24+
testbench: 4.*
25+
carbon: 2.*
26+
- laravel: 5.8.*
27+
testbench: 3.*
28+
carbon: 2.*
29+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
34+
- name: Setup PHP
35+
uses: shivammathur/setup-php@v2
36+
with:
37+
php-version: ${{ matrix.php }}
38+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
39+
coverage: xdebug
40+
41+
- name: Setup problem matchers
42+
run: |
43+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
44+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
45+
46+
- name: Install dependencies
47+
run: |
48+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update
49+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
50+
51+
- name: List Installed Dependencies
52+
run: composer show -D
53+
54+
- name: Execute tests and coverage
55+
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml
56+
57+
- name: Upload coverage results to Coveralls
58+
uses: coverallsapp/github-action@v2
59+
env:
60+
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
61+
# Note: This is the only path that the Coveralls GitHub Action supports.
62+
# So we cannot use something like .Build/coverage/clover.xml here.
63+
file: build/logs/clover.xml
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Update Changelog"
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
update:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
ref: master
19+
20+
- name: Update Changelog
21+
uses: stefanzweifel/changelog-updater-action@v1
22+
with:
23+
latest-version: ${{ github.event.release.name }}
24+
release-notes: ${{ github.event.release.body }}
25+
26+
- name: Commit updated CHANGELOG
27+
uses: stefanzweifel/git-auto-commit-action@v5
28+
with:
29+
branch: master
30+
commit_message: Update CHANGELOG
31+
file_pattern: CHANGELOG.md

.gitignore

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1-
vendor/
1+
# Composer Related
22
composer.lock
3+
/vendor
4+
5+
# Caches
6+
.phpunit.cache
7+
.phpunit.result.cache
8+
/build
9+
10+
# IDE Helper
11+
_ide_helper.php
12+
_ide_helper_models.php
13+
.phpstorm.meta.php
14+
15+
# Editors
16+
/.idea
17+
/.fleet
18+
/.vscode

.scrutinizer.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# Laravel 5 WooCommerce API Client
22

33
[![Latest Version on Packagist](https://img.shields.io/packagist/v/pixelpeter/laravel5-woocommerce-api-client.svg?style=flat-square)](https://packagist.org/packages/pixelpeter/laravel5-woocommerce-api-client)
4-
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
5-
[![Travis Build](https://img.shields.io/travis/pixelpeter/laravel5-woocommerce-api-client/master.svg?style=flat-square)](https://travis-ci.org/pixelpeter/laravel5-woocommerce-api-client)
6-
[![Scrutinizer Quality](https://img.shields.io/scrutinizer/g/pixelpeter/laravel5-woocommerce-api-client.svg?style=flat-square)](https://scrutinizer-ci.com/g/pixelpeter/laravel5-woocommerce-api-client)
7-
[![Scrutinizer Build](https://img.shields.io/scrutinizer/build/g/pixelpeter/laravel5-woocommerce-api-client.svg?style=flat-square)](https://scrutinizer-ci.com/g/pixelpeter/laravel5-woocommerce-api-client)
8-
[![SensioLabsInsight](https://img.shields.io/sensiolabs/i/edfbddc6-ccbc-425c-9db8-726a5bc371e7.svg?style=flat-square)](https://insight.sensiolabs.com/projects/edfbddc6-ccbc-425c-9db8-726a5bc371e7)
94
[![Total Downloads](https://img.shields.io/packagist/dt/pixelpeter/laravel5-woocommerce-api-client.svg?style=flat-square)](https://packagist.org/packages/pixelpeter/laravel5-woocommerce-api-client)
5+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
106
[![Coverage Status](https://coveralls.io/repos/github/pixelpeter/laravel5-woocommerce-api-client/badge.svg?branch=master)](https://coveralls.io/github/pixelpeter/laravel5-woocommerce-api-client?branch=master)
7+
[![Tests](https://github.com/pixelpeter/laravel5-woocommerce-api-client/actions/workflows/run-tests.yml/badge.svg?branch=master)](https://github.com/pixelpeter/laravel5-woocommerce-api-client/actions/workflows/run-tests.yml)
8+
[![Fix PHP code style issues](https://github.com/pixelpeter/laravel5-woocommerce-api-client/actions/workflows/fix-php-code-style-issues.yml/badge.svg)](https://github.com/pixelpeter/laravel5-woocommerce-api-client/actions/workflows/fix-php-code-style-issues.yml)
9+
[![PHPStan](https://github.com/pixelpeter/laravel5-woocommerce-api-client/actions/workflows/phpstan.yml/badge.svg)](https://github.com/pixelpeter/laravel5-woocommerce-api-client/actions/workflows/phpstan.yml)
10+
[![dependabot-auto-merge](https://github.com/pixelpeter/laravel5-woocommerce-api-client/actions/workflows/dependabot-auto-merge.yml/badge.svg)](https://github.com/pixelpeter/laravel5-woocommerce-api-client/actions/workflows/dependabot-auto-merge.yml)
1111

1212
A simple Laravel 5 wrapper for the [official WooCommerce REST API PHP Library](https://github.com/woothemes/wc-api-php) from Automattic.
1313

1414
## Version overview
1515

1616
| Laravel | wc-api-php used | Wordpress | Woocommerce | WC API version | use branch |
17-
| ------ | --------------- | --------- | ------------- | --------------------------------- | ---------- |
18-
| 5.7+ | 2.x | 4.4+ | 3.5+ | v1, v2, v3 | w.i.p. |
17+
| ------ | --------------- | --------- | ------------- | --------------------------------- |------------|
18+
| 5.7+ | 2.x | 4.4+ | 3.5+ | v1, v2, v3 | master |
1919
| 5.5+ | 1.3.x | 4.4+ | 3.0 - 3.4.x | v1, v2, v3 | ^3.0 |
2020
| 5.4+ | 1.3.x | 4.4+ | 2.6 - 2.6.14 | v1, v2 | ^2.0 |
2121
| 5.3 | 1.3.x | 4.1+ | 2.1 - 2.5.5 | legacy v1, legacy v2, legacy v3 | ^1.0 |

0 commit comments

Comments
 (0)