Skip to content

Commit

Permalink
Major update on WP-CLI and setup (#826)
Browse files Browse the repository at this point in the history
* Major update on WP-CLI and setup
  • Loading branch information
iruzevic authored May 15, 2024
1 parent 1ee7b0c commit 4f5cab4
Show file tree
Hide file tree
Showing 170 changed files with 821 additions and 10,369 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
/setup export-ignore
/CODE_OF_CONDUCT.md export-ignore
/CHANGELOG.md export-ignore=
/tests export-ignore
/__mocks__ export-ignore
/readme export-ignore

/.eslintignore export-ignore
Expand Down
99 changes: 7 additions & 92 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Continuous integration checks
name: Continuous Integration

on:
# Run on PRs and pushes, only on significant changes.
push:
branches:
- develop
Expand All @@ -12,105 +11,21 @@ on:
paths-ignore:
- '**.md'

# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: File linting on Node v${{ matrix.node }}
name: Lint assets JS and CSS using Node version - ${{ matrix.node }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allowed_failure }}
strategy:
fail-fast: false
matrix:
node: [ '18' ]
allowed_failure: [ false ]
include:
# Test against latest Node version, but allow it to fail.
# We need success only on LTS versions.
- node: '20'
allowed_failure: true

node: [ 'latest' ]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set Node.js version
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Install node packages
run: npm install

- name: Run linters
run: npm run lint

phpcs:
name: PHPCS check on PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.2' ]

steps:
# Checkout repository
- name: Checkout
uses: actions/checkout@v3

# Setup PHP versions, run checks
- name: PHP setup
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: cs2pr

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
- name: Lint assets
uses: infinum/eightshift-deploy-actions-public/.github/actions/lint-assets@main
with:
dependency-versions: highest

- name: Check coding standards using PHPCS
continue-on-error: true
run: composer standards:check -- --runtime-set testVersion ${{ matrix.php }}- --report-full --report-checkstyle=./phpcs-report.xml

- name: Show PHPCS results in PR
run: cs2pr ./phpcs-report.xml

phpstan:
name: PHPStan check
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allowed_failure }}
strategy:
fail-fast: false
matrix:
php: [ '8.2' ]
allowed_failure: [ true ]

steps:
# Checkout repository
- name: Checkout
uses: actions/checkout@v3

# Setup PHP versions, run checks
- name: PHP setup
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: highest

- name: Check code consistency using PHPStan
run: composer test:types
NODE_VERSION: ${{ matrix.node }}
PROJECT_PATH: '/'
62 changes: 0 additions & 62 deletions .github/workflows/tests.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.

This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/).

## [12.0.0] - TBA
## [12.0.0]

Dependant to [[email protected]](https://github.com/infinum/eightshift-libs/releases/tag/8.0.0)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Infinum and Eightshift
Copyright Infinum

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Eightshift Frontend Libs is maintained and sponsored by
[Eightshift](https://eightshift.com) and [Infinum](https://infinum.com).

## License
Eightshift Frontend Libs ©2022 [Eightshift](https://eightshift.com) and [Infinum](https://infinum.com). It is free software, and may be redistributed under the terms specified in the LICENSE file.
Eightshift Frontend Libs [Eightshift](https://eightshift.com) and [Infinum](https://infinum.com). It is free software, and may be redistributed under the terms specified in the LICENSE file.
5 changes: 0 additions & 5 deletions __mocks__/@eightshift/frontend-libs/mocks/wrapper.js

This file was deleted.

2 changes: 0 additions & 2 deletions __mocks__/@eightshift/frontend-libs/scripts/editor.js

This file was deleted.

2 changes: 0 additions & 2 deletions __mocks__/@eightshift/frontend-libs/scripts/helpers.js

This file was deleted.

18 changes: 0 additions & 18 deletions __mocks__/@wordpress/block-editor.js

This file was deleted.

23 changes: 0 additions & 23 deletions __mocks__/@wordpress/blocks.js

This file was deleted.

38 changes: 0 additions & 38 deletions __mocks__/@wordpress/data.js

This file was deleted.

16 changes: 0 additions & 16 deletions __mocks__/@wordpress/element.js

This file was deleted.

7 changes: 0 additions & 7 deletions __mocks__/react-html-parser.js

This file was deleted.

4 changes: 1 addition & 3 deletions babel/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
module.exports = api => {
const isTest = api.env('test');

return {
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: '3',
modules: isTest ? 'auto' : false,
modules: false,
},
],
['@babel/preset-react'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
/**
* Template for the Admin header/footer picker settings screen.
*
* @package EightshiftBoilerplate
* @package %g_namespace%
*/

use EightshiftBoilerplate\AdminMenus\ReusableBlocksHeaderFooter;
use EightshiftBoilerplateVendor\EightshiftLibs\Helpers\Components;
use %g_namespace%\AdminMenus\ReusableBlocksHeaderFooter;
use %g_namespace_vendor_prefix%\EightshiftLibs\Helpers\Helpers;

$manifest = Components::getManifestByDir(__DIR__);
$manifest = Helpers::getManifestByDir(__DIR__);
?>

<div class="wrap">
<?php
// Show admin messages.
if (isset($_GET['settings-updated'])) { // phpcs:ignore
add_settings_error(ReusableBlocksHeaderFooter::ADMIN_MESSAGE_SLUG, 'save_success', __('Settings saved', 'eightshift-frontend-libs'), 'updated');
add_settings_error(ReusableBlocksHeaderFooter::ADMIN_MESSAGE_SLUG, 'save_success', __('Settings saved', '%g_textdomain%'), 'updated');
}

// Render update messages.
Expand All @@ -33,7 +33,7 @@
do_settings_sections(ReusableBlocksHeaderFooter::ADMIN_MENU_SLUG);

// Render save button.
submit_button(__('Save', 'eightshift-frontend-libs'));
submit_button(__('Save', '%g_textdomain%'));
?>
</form>
</div>
Expand Down
Loading

0 comments on commit 4f5cab4

Please sign in to comment.