Skip to content

Commit

Permalink
Apply formatting with Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
oakesjosh committed Feb 26, 2024
1 parent fc3c280 commit 5484ce8
Show file tree
Hide file tree
Showing 507 changed files with 185,048 additions and 124,904 deletions.
102 changes: 51 additions & 51 deletions .github/workflows/pup-build-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,56 @@ name: Generate Zip (Pup)
run-name: '[Build] ${{ github.ref_name }}'

on:
workflow_dispatch:
inputs:
ref:
description: 'Git Commit Ref (branch, tag, or hash)'
default: 'master'
required: true
type: string
production:
description: 'Is this a production build?'
default: false
type: boolean
workflow_dispatch:
inputs:
ref:
description: 'Git Commit Ref (branch, tag, or hash)'
default: 'master'
required: true
type: string
production:
description: 'Is this a production build?'
default: false
type: boolean

jobs:
generate-zip:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- name: install pup
run: composer -- pup

- name: pup build
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.COMPOSER_TOKEN }}"}}'
run: composer -- pup build

- name: pup check
run: composer -- pup check

- name: pup i18n
run: composer -- pup i18n

- name: get version
if: ${{ inputs.production }}
run: echo "VERSION=$(composer -- pup get-version)" >> $GITHUB_ENV

- name: get dev version
if: ${{ !inputs.production }}
run: echo "VERSION=$(composer -- pup get-version --dev)" >> $GITHUB_ENV

- name: get zip name
run: echo "ZIP_NAME=$(composer -- pup zip-name ${{ env.VERSION }})" >> $GITHUB_ENV

- name: pup package
run: composer -- pup package ${{ env.VERSION }}

- name: Upload plugin artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ZIP_NAME }}
path: .pup-zip
generate-zip:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- name: install pup
run: composer -- pup

- name: pup build
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.COMPOSER_TOKEN }}"}}'
run: composer -- pup build

- name: pup check
run: composer -- pup check

- name: pup i18n
run: composer -- pup i18n

- name: get version
if: ${{ inputs.production }}
run: echo "VERSION=$(composer -- pup get-version)" >> $GITHUB_ENV

- name: get dev version
if: ${{ !inputs.production }}
run: echo "VERSION=$(composer -- pup get-version --dev)" >> $GITHUB_ENV

- name: get zip name
run: echo "ZIP_NAME=$(composer -- pup zip-name ${{ env.VERSION }})" >> $GITHUB_ENV

- name: pup package
run: composer -- pup package ${{ env.VERSION }}

- name: Upload plugin artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ZIP_NAME }}
path: .pup-zip
223 changes: 111 additions & 112 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,115 +1,114 @@
name: 'CI'
on:
workflow_dispatch:
pull_request:
push:
workflow_dispatch:
pull_request:
push:
jobs:
test:
runs-on: ubuntu-latest

env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.COMPOSER_TOKEN }}"}}'

strategy:
matrix:
wordpress:
- latest
- '6.3.3'
- '6.2.4'
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'

name: WP ${{ matrix.wordpress }} / PHP ${{ matrix.php }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Checkout slic
uses: actions/checkout@v4
with:
repository: stellarwp/slic
ref: 1.5.1
path: slic
fetch-depth: 1

- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- run: bun install --frozen-lockfile

- name: Build packages
run: bun run build

- name: Get Composer Cache Directory
id: get-composer-cache-dir
run: |
echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: composer-cache
with:
path: ${{ steps.get-composer-cache-dir.outputs.DIR }}
key: ${{ matrix.php }}-composer-${{ hashFiles('composer.lock') }}
restore-keys: |
${{ matrix.php }}-composer-
- name: Set up slic env vars
run: |
echo "SLIC_BIN=${GITHUB_WORKSPACE}/slic/slic" >> $GITHUB_ENV
echo "SLIC_WP_DIR=${GITHUB_WORKSPACE}/slic/_wordpress" >> $GITHUB_ENV
echo "SLIC_WORDPRESS_DOCKERFILE=Dockerfile.base" >> $GITHUB_ENV
- name: Set run context for slic
run: echo "SLIC=1" >> $GITHUB_ENV && echo "CI=1" >> $GITHUB_ENV

- name: Start ssh-agent
run: |
mkdir -p "${HOME}/.ssh";
ssh-agent -a /tmp/ssh_agent.sock;
- name: Export SSH_AUTH_SOCK env var
run: echo "SSH_AUTH_SOCK=/tmp/ssh_agent.sock" >> $GITHUB_ENV

- name: Set up slic for CI
run: |
cd ${GITHUB_WORKSPACE}/..
${SLIC_BIN} here
${SLIC_BIN} interactive off
${SLIC_BIN} build-prompt off
${SLIC_BIN} build-subdir off
${SLIC_BIN} xdebug off
${SLIC_BIN} debug on
${SLIC_BIN} php-version set ${{ matrix.php }} --skip-rebuild
${SLIC_BIN} composer-cache set ${{ steps.get-composer-cache-dir.outputs.DIR }}
${SLIC_BIN} info
${SLIC_BIN} config
- name: Install specific WordPress version
run: |
${SLIC_BIN} wp core download --version=${{ matrix.wordpress }} --force
${SLIC_BIN} wp core version
- name: Set up plugin
run: |
${SLIC_BIN} use kadence-blocks
${SLIC_BIN} composer set-version 2
${SLIC_BIN} composer validate
${SLIC_BIN} composer install
- name: Run wpunit tests
run: ${SLIC_BIN} run wpunit --ext DotReporter

- name: Run acceptance tests
run: ${SLIC_BIN} run acceptance --ext DotReporter

- name: Upload codeception output
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: "${{ matrix.test }}-${{ matrix.php }}-${{ matrix.wordpress }}-output"
path: "./tests/_output"

test:
runs-on: ubuntu-latest

env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.COMPOSER_TOKEN }}"}}'

strategy:
matrix:
wordpress:
- latest
- '6.3.3'
- '6.2.4'
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'

name: WP ${{ matrix.wordpress }} / PHP ${{ matrix.php }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Checkout slic
uses: actions/checkout@v4
with:
repository: stellarwp/slic
ref: 1.5.1
path: slic
fetch-depth: 1

- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- run: bun install --frozen-lockfile

- name: Build packages
run: bun run build

- name: Get Composer Cache Directory
id: get-composer-cache-dir
run: |
echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: composer-cache
with:
path: ${{ steps.get-composer-cache-dir.outputs.DIR }}
key: ${{ matrix.php }}-composer-${{ hashFiles('composer.lock') }}
restore-keys: |
${{ matrix.php }}-composer-
- name: Set up slic env vars
run: |
echo "SLIC_BIN=${GITHUB_WORKSPACE}/slic/slic" >> $GITHUB_ENV
echo "SLIC_WP_DIR=${GITHUB_WORKSPACE}/slic/_wordpress" >> $GITHUB_ENV
echo "SLIC_WORDPRESS_DOCKERFILE=Dockerfile.base" >> $GITHUB_ENV
- name: Set run context for slic
run: echo "SLIC=1" >> $GITHUB_ENV && echo "CI=1" >> $GITHUB_ENV

- name: Start ssh-agent
run: |
mkdir -p "${HOME}/.ssh";
ssh-agent -a /tmp/ssh_agent.sock;
- name: Export SSH_AUTH_SOCK env var
run: echo "SSH_AUTH_SOCK=/tmp/ssh_agent.sock" >> $GITHUB_ENV

- name: Set up slic for CI
run: |
cd ${GITHUB_WORKSPACE}/..
${SLIC_BIN} here
${SLIC_BIN} interactive off
${SLIC_BIN} build-prompt off
${SLIC_BIN} build-subdir off
${SLIC_BIN} xdebug off
${SLIC_BIN} debug on
${SLIC_BIN} php-version set ${{ matrix.php }} --skip-rebuild
${SLIC_BIN} composer-cache set ${{ steps.get-composer-cache-dir.outputs.DIR }}
${SLIC_BIN} info
${SLIC_BIN} config
- name: Install specific WordPress version
run: |
${SLIC_BIN} wp core download --version=${{ matrix.wordpress }} --force
${SLIC_BIN} wp core version
- name: Set up plugin
run: |
${SLIC_BIN} use kadence-blocks
${SLIC_BIN} composer set-version 2
${SLIC_BIN} composer validate
${SLIC_BIN} composer install
- name: Run wpunit tests
run: ${SLIC_BIN} run wpunit --ext DotReporter

- name: Run acceptance tests
run: ${SLIC_BIN} run acceptance --ext DotReporter

- name: Upload codeception output
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: '${{ matrix.test }}-${{ matrix.php }}-${{ matrix.wordpress }}-output'
path: './tests/_output'
20 changes: 10 additions & 10 deletions codeception.dist.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
actor: Tester
bootstrap: _bootstrap.php
paths:
tests: tests
log: tests/_output
output: tests/_output
data: tests/_data
helpers: tests/_support
wp_root: "%WP_ROOT_FOLDER%"
tests: tests
log: tests/_output
output: tests/_output
data: tests/_data
helpers: tests/_support
wp_root: '%WP_ROOT_FOLDER%'
settings:
colors: true
memory_limit: 1024M
colors: true
memory_limit: 1024M
params:
# read dynamic configuration parameters from the .env file
- .env.testing
# read dynamic configuration parameters from the .env file
- .env.testing
4 changes: 2 additions & 2 deletions codeception.slic.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
params:
# read dynamic configuration parameters from the .env file
- .env.testing.slic
# read dynamic configuration parameters from the .env file
- .env.testing.slic
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@
"namespace_prefix": "KadenceWP\\KadenceBlocks\\",
"delete_vendor_packages": false,
"exclude_from_prefix": {
"file_patterns": [
"/symfony\\/polyfill-(.*)/"
]
"file_patterns": [
"/symfony\\/polyfill-(.*)/"
]
}
}
}
Expand Down
Loading

0 comments on commit 5484ce8

Please sign in to comment.