Merge pull request #192 from creative-commoners/pulls/2.2/standardise-modules

MNT Standardise modules
This commit is contained in:
Guy Sartorelli 2022-08-02 15:50:59 +12:00 committed by GitHub
commit 08554e7882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 30 deletions

View File

@ -12,5 +12,5 @@ jobs:
ci: ci:
name: CI name: CI
# Only run cron on the silverstripe account # Only run cron on the silverstripe account
if: (github.event_name == 'schedule' && startsWith(github.repository, 'silverstripe/')) || (github.event_name != 'schedule') if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule')
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1 uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1

View File

@ -10,7 +10,7 @@ jobs:
keepalive: keepalive:
name: Keepalive name: Keepalive
# Only run cron on the silverstripe account # Only run cron on the silverstripe account
if: (github.event_name == 'schedule' && startsWith(github.repository, 'silverstripe/')) || (github.event_name != 'schedule') if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule')
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Keepalive - name: Keepalive

View File

@ -1,15 +0,0 @@
inherit: true
build:
nodes:
analysis:
tests:
override: [php-scrutinizer-run]
checks:
php:
code_rating: true
duplication: true
filter:
paths: [src/*, tests/*]

View File

@ -1,4 +0,0 @@
version: ~> 1.0
import:
- silverstripe/silverstripe-travis-shared:config/provision/standard-jobs-range.yml

View File

@ -1,9 +1,7 @@
# Widgets Module # Widgets Module
[![CI](https://github.com/silverstripe/silverstripe-widgets/actions/workflows/ci.yml/badge.svg)](https://github.com/silverstripe/silverstripe-widgets/actions/workflows/ci.yml) [![CI](https://github.com/silverstripe/silverstripe-widgets/actions/workflows/ci.yml/badge.svg)](https://github.com/silverstripe/silverstripe-widgets/actions/workflows/ci.yml)
[![SilverStripe supported module](https://img.shields.io/badge/silverstripe-supported-0071C4.svg)](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/) [![Silverstripe supported module](https://img.shields.io/badge/silverstripe-supported-0071C4.svg)](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/)
[![Code Quality](http://img.shields.io/scrutinizer/g/silverstripe/silverstripe-widgets.svg)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-widgets)
[![Code Coverage](https://img.shields.io/codecov/c/github/silverstripe/silverstripe-widgets.svg)](https://codecov.io/gh/silverstripe/silverstripe-widgets)
## Overview ## Overview
@ -12,9 +10,9 @@ the sidebar of your website.
## Requirements ## Requirements
* SilverStripe 4.0 * Silverstripe 4.0
**Note:** this version is compatible with SilverStripe 4. For SilverStripe 3, please see [the 1.x release line](https://github.com/silverstripe/silverstripe-widgets/tree/1.3). **Note:** this version is compatible with Silverstripe 4. For Silverstripe 3, please see [the 1.x release line](https://github.com/silverstripe/silverstripe-widgets/tree/1.3).
### Installation ### Installation
@ -49,7 +47,7 @@ Here's an example on how to just add widgets to a `MyPage` type, and call it
By following the "Packaging" rules below, widgets are easily installed. This example uses the Blog module which by default has widgets already enabled. By following the "Packaging" rules below, widgets are easily installed. This example uses the Blog module which by default has widgets already enabled.
* Install the [blog module](https://github.com/silverstripe/silverstripe-blog/). * Install the [blog module](https://github.com/silverstripe/silverstripe-blog/).
* Download the widget and unzip to the main folder of your SilverStripe website, e.g. to `/widget_<widget-name>/`. The folder * Download the widget and unzip to the main folder of your Silverstripe website, e.g. to `/widget_<widget-name>/`. The folder
will contain a few files, which generally won't need editing or reading. will contain a few files, which generally won't need editing or reading.
* Run `http://my-website.com/dev/build` * Run `http://my-website.com/dev/build`
* Login to the CMS and go to the 'Blog' page. Choose the "widgets" tab and click the new widget to activate it. * Login to the CMS and go to the 'Blog' page. Choose the "widgets" tab and click the new widget to activate it.
@ -204,10 +202,9 @@ class FlickrWidget extends Widget
<% end_control %> <% end_control %>
``` ```
## Releasing a widget ## Releasing a widget
Follow the [standard procedures defined for releasing a SilverStripe module](https://docs.silverstripe.org/en/4/developer_guides/extending/how_tos/publish_a_module). Follow the [standard procedures defined for releasing a Silverstripe module](https://docs.silverstripe.org/en/4/developer_guides/extending/how_tos/publish_a_module).
Here is a composer template you can use. Here is a composer template you can use.
@ -255,7 +252,7 @@ You need to finish off / change:
To call a single Widget in a page - without adding a widget area in the CMS for you to add / delete the widgets, you can To call a single Widget in a page - without adding a widget area in the CMS for you to add / delete the widgets, you can
define a merge variable in the Page Controller and include it in the Page Template. define a merge variable in the Page Controller and include it in the Page Template.
This example creates an RSSWidget with the SilverStripe blog feed. This example creates an RSSWidget with the Silverstripe blog feed.
```php ```php
public function SilverStripeFeed() public function SilverStripeFeed()

View File

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/silverstripe/cms/tests/bootstrap.php" colors="true"> <phpunit bootstrap="vendor/silverstripe/cms/tests/bootstrap.php" colors="true">
<testsuites> <testsuites>
<testsuite name="Default"> <testsuite name="Default">