Skip to content

Commit

Permalink
Merge pull request #11 from stevegrunwell/release/v1.1.2
Browse files Browse the repository at this point in the history
Version 1.1.2
  • Loading branch information
stevegrunwell authored Jan 19, 2022
2 parents b9bfb7d + 37e0ccd commit a83fbc4
Show file tree
Hide file tree
Showing 10 changed files with 2,001 additions and 731 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# This is the main CI/CD pipeline for the WP101 Plugin SaaS.
#
# Any time code is pushed to one of the main branches or a PR is opened, this pipeline should be
# run to ensure everything still works as designed and meets our coding standards.
name: CI Pipeline

# Execute on pushes to `develop` and `main`, as well as all PRs.
on:
push:
branches:
- develop
- main
pull_request:

jobs:
phpunit:
name: PHPUnit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Configure PHP environment
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHPUnit
run: ./vendor/bin/phpunit --testdox --colors=always

coding-standards:
name: Coding standards
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Configure PHP environment
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, intl
coverage: none

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Check coding standards
run: ./vendor/bin/php-cs-fixer fix --dry-run --verbose
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/vendor/
.php_cs.cache
.php-cs-fixer.cache
.phpunit.result.cache
13 changes: 13 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->exclude(__FILE__)
->in(__DIR__);

$config = new PhpCsFixer\Config();
return $config->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
])
->setFinder($finder);
14 changes: 0 additions & 14 deletions .php_cs.dist

This file was deleted.

45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Version 1.1.2] – 2022-01-18

* Add PHP 8 support in `composer.json` ([#9])
* Move from Travis CI to GitHub Actions ([#10])
* Rename `master` to `main`

## [Version 1.1.1] — 2019-11-25

* Fixed a copy+paste error in the comment for `ONE_MINUTE`.
Expand Down Expand Up @@ -34,10 +40,13 @@ Initial public release of the library, with the following constants:
* `YEAR_IN_MINUTES` (525,600 minutes)


[Unreleased]: https://github.com/stevegrunwell/time-constants/compare/master...develop
[Unreleased]: https://github.com/stevegrunwell/time-constants/compare/main...develop
[Version 1.1.2]: https://github.com/stevegrunwell/time-constants/releases/tag/v1.1.2
[Version 1.1.1]: https://github.com/stevegrunwell/time-constants/releases/tag/v1.1.1
[Version 1.1.0]: https://github.com/stevegrunwell/time-constants/releases/tag/v1.1.0
[Version 1.0.0]: https://github.com/stevegrunwell/time-constants/releases/tag/v1.0.0
[#2]: https://github.com/stevegrunwell/time-constants/pull/2
[#3]: https://github.com/stevegrunwell/time-constants/pull/3
[#5]: https://github.com/stevegrunwell/time-constants/pull/5
[#9]: https://github.com/stevegrunwell/time-constants/pull/9
[#10]: https://github.com/stevegrunwell/time-constants/pull/10
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If the requirements changed and we needed to cache the value for multiple days,
cache($cacheKey, $value, 5 * DAY_IN_SECONDS);
```

These constants may seem familiar to WordPress developers, as they're absolutely [inspired by WordPress' use of time constants](https://codex.wordpress.org/Easier_Expression_of_Time_Constants). This package goes a bit further, however, adding `*_IN_MINUTES` constants, for easier use with libraries like [Laravel's `Cache` facade](https://laravel.com/docs/5.6/cache#cache-usage).
These constants may seem familiar to WordPress developers, as they're absolutely [inspired by WordPress' use of time constants](https://codex.wordpress.org/Easier_Expression_of_Time_Constants). This package goes a bit further, however, adding `*_IN_MINUTES` constants, for easier use with libraries like [Laravel's `Cache` facade](https://laravel.com/docs/master/cache#cache-usage).

## Installation

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"source": "https://github.com/stevegrunwell/time-constants"
},
"require": {
"php": "^7.0"
"php": "^7.0 | ^8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.13",
"phpunit/phpunit": "^6.0"
"friendsofphp/php-cs-fixer": "^3.5",
"phpunit/phpunit": "^9.5"
},
"autoload": {
"files": ["constants.php"]
Expand All @@ -34,7 +34,7 @@
"sort-packages": true,
"optimize-autoloader": true,
"platform": {
"php": "7.2"
"php": "8.1"
}
}
}
Loading

0 comments on commit a83fbc4

Please sign in to comment.