Skip to content

Commit

Permalink
Committing built version of 6d9b679
Browse files Browse the repository at this point in the history
  • Loading branch information
10upbot on GitHub committed Jul 6, 2023
1 parent 7e1dd94 commit c16e954
Show file tree
Hide file tree
Showing 116 changed files with 4,187 additions and 7,220 deletions.
33 changes: 28 additions & 5 deletions .github/workflows/build-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,53 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
uses: actions/checkout@v3.5.3
- name: Use desired version of NodeJS
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Set PHP version
uses: shivammathur/setup-php@2.25.4
with:
php-version: 7.4
tools: composer:v2, wp

- name: Clone stable branch to the release folder
env:
GITHUB_REPOSITORY: ${{ github.event.repository.name }}
run: |
git clone --depth 1 --branch stable https://github.com/$GITHUB_REPOSITORY.git release
cd release
git branch --show-current
mv .git $RUNNER_TEMP/.git
cd ..
- name: Check versions
run: npm -v; node -v
run: |
npm -v
node -v
php -v
composer -v
- name: Install and build
run: |
composer install --no-dev
npm install
npm run makepot
npm run release
- name: Push to Stable
env:
GITHUB_REPOSITORY: ${{ github.event.repository.name }}
GITHUB_SHA: ${{ github.event.commits[0].sha }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd release
mv $RUNNER_TEMP/.git .git
git branch --show-current
git config --global user.email "10upbot+github@10up.com"
git config --global user.name "10upbot on GitHub"
git remote set-url origin "https://x-access-token:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git"
cd release
git add .
git commit -m "Committing built version of $GITHUB_SHA"
git push origin stable
git push origin HEAD:stable
74 changes: 67 additions & 7 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,80 @@ on:
- develop
- develop-v1
jobs:
build:
name: NPM Install
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use desired version of NodeJS
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Cache Node
uses: actions/cache@v3
with:
path: |
node_modules
~/.cache
~/.npm
key: ${{ hashFiles('package-lock.json') }}

- name: Install dependencies
run: npm install

cypress:
name: ${{ matrix.core.name }} / ${{ matrix.php.name }}
needs: [build]
## Pending upgrade of `@wordpress/env` package.
continue-on-error: ${{ matrix.core.version == 'WordPress/WordPress#master' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- {name: 'PHP Default', version: null}
core:
- {name: 'WP latest', version: 'latest'}
- {name: 'WP stable', version: 'latest'}
- {name: 'WP 5.7', version: 'WordPress/WordPress#5.7'}
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}
include:
- php: {name: 'PHP 7.4', version: '7.4'}
core: {name: 'WP 5.7', version: 'WordPress/WordPress#5.7'}
- php: {name: 'PHP 8.1', version: '8.1'}
core: {name: 'WP stable', version: 'latest'}
- php: {name: 'PHP 7.4', version: '7.4' }
core: {name: 'WP minimum', version: 'WordPress/WordPress#5.2'}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use desired version of NodeJS
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Check versions
run: npm -v; node -v

- name: Cache Node
uses: actions/cache@v3
with:
path: |
node_modules
~/.cache
~/.npm
key: ${{ hashFiles('package-lock.json') }}

- name: Install dependencies
run: npm install

- name: Composer install
run: composer install

- name: Build
run: npm run build

- name: Set the core version
run: |
./tests/bin/set-core-version.js ${{ matrix.core.version }} ${{ matrix.php.version }}
Expand All @@ -54,11 +97,28 @@ jobs:
npx wp-env run cli "wp core version"
npx wp-env run cli "php --version"
- name: Convert to multisite
run: npm run to-multisite

- name: Copy .htaccess
run: npm run copy-htaccess

- name: Test
run: npm run cypress:run
run: npm run cypress:run --config-file tests/cypress/config.js

- name: Update summary
if: always()
run: |
npx mochawesome-merge ./tests/cypress/reports/*.json -o tests/cypress/reports/mochawesome.json
rm -rf ./tests/cypress/reports/mochawesome-*.json
npx mochawesome-json-to-md -p ./tests/cypress/reports/mochawesome.json -o ./tests/cypress/reports/mochawesome.md
npx mochawesome-report-generator tests/cypress/reports/mochawesome.json -o tests/cypress/reports/
cat ./tests/cypress/reports/mochawesome.md >> $GITHUB_STEP_SUMMARY
- name: Make artifacts available
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-artifact
retention-days: 2
path: |
${{ github.workspace }}/tests/cypress/screenshots/
${{ github.workspace }}/tests/cypress/videos/
${{ github.workspace }}/tests/cypress/logs/
${{ github.workspace }}/tests/cypress/reports/
8 changes: 6 additions & 2 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ jobs:
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v1
- name: Dependency Review
uses: actions/dependency-review-action@v3
with:
license-check: true
vulnerability-check: false
config-file: 10up/.github/.github/dependency-review-config.yml@trunk
49 changes: 49 additions & 0 deletions .github/workflows/generate-zip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Generate ZIP

on:
workflow_dispatch:
inputs:
ref:
description: 'Git Commit Ref (branch, tag, or hash)'
required: false
type: string

jobs:
generate_zip:
name: New ZIP file
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
with:
ref: ${{ inputs.ref }}
- name: Use desired version of NodeJS
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Set PHP version
uses: shivammathur/setup-php@2.17.0
with:
php-version: 7.4
tools: composer:v2, wp
- name: Check versions
run: |
npm -v
node -v
php -v
composer -v
- name: Install and build
run: |
composer install --no-dev
npm install
npm run release
npm run plugin-zip
rm -rf ./release && unzip ${{ github.event.repository.name }}.zip -d ./release
- name: Upload the ZIP file as an artifact
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: release
retention-days: 5
82 changes: 45 additions & 37 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,53 +25,61 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Cache Node
uses: actions/cache@v3
with:
path: |
node_modules
~/.cache
~/.npm
key: ${{ hashFiles('package-lock.json') }}
- name: Check versions
run: npm -v; node -v
- name: npm install
run: npm install
- name: eslint
uses: icrawl/action-eslint@v1
- name: Generate linting report
run: npm run lint:js -- --output-file eslint-report.json --format json
continue-on-error: true
- name: Annotate code linting results
uses: ataylorme/eslint-annotate-action@1.2.0
with:
custom-glob: assets/js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
repo-token: '${{ secrets.GITHUB_TOKEN }}'
report-json: 'eslint-report.json'
- name: Update summary
run: |
npm_config_yes=true npx github:10up/eslint-json-to-md --path ./eslint-report.json --output ./eslint-report.md
cat eslint-report.md >> $GITHUB_STEP_SUMMARY
if: ${{ failure() }}

phpcs:
name: phpcs
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v2
- id: changed-files
uses: tj-actions/changed-files@v36
with:
files: |
**/*.php
- name: Set standard 10up cache directories
run: |
composer config -g cache-dir "${{ env.COMPOSER_CACHE }}"
- name: Prepare composer cache
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE }}
key: composer-${{ env.COMPOSER_VERSION }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-${{ env.COMPOSER_VERSION }}-
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: composer:v2, cs2pr
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:v2, cs2pr
coverage: none

- name: Install dependencies
run: composer install --ignore-platform-reqs
- name: Install dependencies
run: composer install

- name: Check PHPCS standard
run: ./vendor/bin/phpcs -i
- name: Test all files
if: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/trunk' }}
run: ./vendor/bin/phpcs . --report-full --report-checkstyle=./.github/phpcs-report.xml

- name: PHPCS check
id: phpcs-sniffs
run: ./vendor/bin/phpcs . --runtime-set testVersion 5.6- --report-full --report-checkstyle=./.github/phpcs-report.xml
- name: Test changed files
if: ${{ steps.changed-files.outputs.any_changed == 'true' && github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/trunk' }}
run: ./vendor/bin/phpcs ${{ steps.changed-files.outputs.all_changed_files }} --report-full --report-checkstyle=./.github/phpcs-report.xml --runtime-set testVersion 7.4-

- name: Show PHPCS results in PR
if: ${{ always() }}
run: cs2pr ./.github/phpcs-report.xml
- name: Show PHPCS results in PR
if: ${{ always() }}
run: cs2pr ./.github/phpcs-report.xml
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# We claim to support from 5.6+ but WP Mock only supports 7.1+
php: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ]
php: [ '7.4', '8.0', '8.1' ]
os: [ ubuntu-latest ]

steps:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/wordpress-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "WordPress version checker"
on:
push:
branches:
- develop
- trunk
pull_request:
branches:
- develop
schedule:
- cron: '0 0 * * 1'

jobs:
wordpress-version-checker:
runs-on: ubuntu-latest
steps:
- name: WordPress version checker
uses: skaut/wordpress-version-checker@v1.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit c16e954

Please sign in to comment.