Skip to content

Commit

Permalink
Merge branch 'develop' into deploy
Browse files Browse the repository at this point in the history
# Conflicts:
#	readme.md
  • Loading branch information
johnbillion committed Nov 16, 2023
2 parents 99f6957 + a489687 commit 52537d9
Show file tree
Hide file tree
Showing 56 changed files with 4,519 additions and 1,522 deletions.
24 changes: 0 additions & 24 deletions .distignore

This file was deleted.

16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_style = space
indent_size = 2
26 changes: 26 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
* text=auto

# Directories
/.git export-ignore
/.github export-ignore
/.wordpress-org export-ignore
/node_modules export-ignore
/tests export-ignore
/vendor export-ignore

# Files
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.npmrc export-ignore
/.nvmrc export-ignore
/CODE_OF_CONDUCT.md export-ignore
/codeception.dist.yml export-ignore
/composer.lock export-ignore
/CONTRIBUTING.md export-ignore
/docker-compose.yml export-ignore
/package-lock.json export-ignore
/package.json export-ignore
/phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/SECURITY.md export-ignore
52 changes: 52 additions & 0 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

name: Acceptance Tests
on:
push:
branches:
- 'develop'
- 'trunk'
- 'master'
pull_request:
branches:
- '**'
schedule:
# Once weekly on Mondays at 04:00 UTC.
#
# ┌───────────── minute (0 - 59)
# │ ┌────────── hour (0 - 23)
# │ │ ┌─────── day of the month (1 - 31)
# │ │ │ ┌──── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌─ day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
- cron: '0 4 * * 1'
workflow_dispatch:

jobs:
test:
name: WP ${{ matrix.wp }} / PHP ${{ matrix.php }}
strategy:
matrix:
wp:
- 'nightly'
- '6.4'
- '6.3'
php:
- '8.2'
- '8.1'
- '8.0'
- '7.4'
dev:
- ${{ github.ref_name == 'develop' }}
exclude:
# Only run the nightly tests on the develop branch.
- wp: 'nightly'
dev: false
fail-fast: false
uses: johnbillion/plugin-infrastructure/.github/workflows/reusable-acceptance-tests.yml@trunk
with:
wp: ${{ matrix.wp }}
php: ${{ matrix.php }}
node: false
46 changes: 0 additions & 46 deletions .github/workflows/changelog.js

This file was deleted.

69 changes: 26 additions & 43 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

name: Coding Standards
on:
push:
Expand All @@ -8,48 +10,29 @@ on:
pull_request:
branches:
- '**'
schedule:
# Once weekly on Mondays at 03:00 UTC.
#
# ┌───────────── minute (0 - 59)
# │ ┌────────── hour (0 - 23)
# │ │ ┌─────── day of the month (1 - 31)
# │ │ │ ┌──── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌─ day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
- cron: '0 3 * * 1'
workflow_dispatch:

jobs:
build:
name: PHP Coding Standards
runs-on: ubuntu-18.04
steps:
- name: Checkout repository
uses: actions/checkout@v1

- name: Composer cache
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: 7.3-composer-${{ hashFiles('composer.json') }}

- name: PHPCS cache
uses: actions/cache@v1
with:
path: tests/cache
# This uses the hash of user-switching.php in its cache key because Actions doesn't support
# always pulling in a cache file and simultaneously always updating it, unlike Travis.
# This way we always pull in a cache file and refresh it with each new version of the plugin.
key: 7.3-phpcs-${{ hashFiles('user-switching.php') }}

- name: Install PHP
uses: shivammathur/setup-php@2.7.0
with:
php-version: '7.3'
coverage: none
env:
fail-fast: true

- name: Debugging
run: |
php --version
composer --version
- name: Install dependencies
run: |
composer install --prefer-dist
- name: Run the tests
run: |
composer test:cs
composer test:phpstan
test:
name: PHP / PHP ${{ matrix.php }}
uses: johnbillion/plugin-infrastructure/.github/workflows/reusable-coding-standards.yml@trunk
strategy:
matrix:
php:
- '8.2'
- '7.4'
fail-fast: false
with:
php: ${{ matrix.php }}
31 changes: 11 additions & 20 deletions .github/workflows/deploy-assets.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

name: Deploy Assets
on:
push:
Expand All @@ -7,23 +9,12 @@ on:
jobs:
wordpress:
name: WordPress.org
runs-on: ubuntu-18.04
steps:
- name: Checkout repository
uses: actions/checkout@v1

# @TODO need to cache the npm dependencies
- name: Install Dependencies
run: npm install

- name: Populate Changelog
run: node .github/workflows/changelog.js readme.md
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-asset-update@1.4.1
env:
SVN_USERNAME: ${{ secrets.WPORG_SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.WPORG_SVN_PASSWORD }}
README_NAME: readme.md
uses: johnbillion/plugin-infrastructure/.github/workflows/reusable-deploy-assets.yml@trunk
with:
plugin: user-switching
readme: readme.md
node: false
vendor: false
secrets:
WPORG_SVN_USERNAME: ${{ secrets.WPORG_SVN_USERNAME }}
WPORG_SVN_PASSWORD: ${{ secrets.WPORG_SVN_PASSWORD }}
34 changes: 13 additions & 21 deletions .github/workflows/deploy-tag.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

name: Deploy Tag
on:
release:
types: [published]

jobs:
wordpress:
name: WordPress.org
runs-on: ubuntu-18.04
steps:
- name: Checkout repository
uses: actions/checkout@v1

# @TODO need to cache the npm dependencies
- name: Install Dependencies
run: npm install
concurrency: WordPress.org

- name: Populate Changelog
run: node .github/workflows/changelog.js readme.md
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@1.4.1
env:
SVN_USERNAME: ${{ secrets.WPORG_SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.WPORG_SVN_PASSWORD }}
jobs:
test:
name: Deploy Tag
uses: johnbillion/plugin-infrastructure/.github/workflows/reusable-deploy-tag.yml@trunk
with:
plugin: user-switching
readme: readme.md
secrets:
WPORG_SVN_USERNAME: ${{ secrets.WPORG_SVN_USERNAME }}
WPORG_SVN_PASSWORD: ${{ secrets.WPORG_SVN_PASSWORD }}
61 changes: 0 additions & 61 deletions .github/workflows/e2e.yml

This file was deleted.

Loading

0 comments on commit 52537d9

Please sign in to comment.