Skip to content

Commit

Permalink
MNT Use GitHub Actions CI
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jul 17, 2022
1 parent fc0f7ba commit a1e8643
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 12 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CI

on:
push:
pull_request:
workflow_dispatch:
# Every Monday at 2:30pm UTC
schedule:
- cron: '30 14 * * 1'

jobs:
ci:
name: CI
# Only run cron on the silverstripe account
if: (github.event_name == 'schedule' && startsWith(github.repository, 'silverstripe/')) || (github.event_name != 'schedule')
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1
17 changes: 17 additions & 0 deletions .github/workflows/keepalive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Keepalive

on:
workflow_dispatch:
# The 4th of every month at 10:50am UTC
schedule:
- cron: '50 10 4 * *'

jobs:
keepalive:
name: Keepalive
# Only run cron on the silverstripe account
if: (github.event_name == 'schedule' && startsWith(github.repository, 'silverstripe/')) || (github.event_name != 'schedule')
runs-on: ubuntu-latest
steps:
- name: Keepalive
uses: silverstripe/gha-keepalive@v1
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Browser Test Session Module

[![Build Status](https://travis-ci.org/silverstripe-labs/silverstripe-testsession.svg)](https://travis-ci.org/silverstripe-labs/silverstripe-testsession)
[![CI](https://github.com/silverstripe/silverstripe-testsession/actions/workflows/ci.yml/badge.svg)](https://github.com/silverstripe/silverstripe-testsession/actions/workflows/ci.yml)

## Overview

Expand Down Expand Up @@ -47,7 +47,7 @@ and interact with it through other URL endpoints.
Commands:

* `dev/testsession`: Shows options for starting a test session
* `dev/testsession/start`: Sets up test state, most commonly a test database will be constructed,
* `dev/testsession/start`: Sets up test state, most commonly a test database will be constructed,
and your browser session will be amended to use this database. See "Parameters" documentation below.
* `dev/testsession/end`: Removes the test state, and resets to the original database.
* `dev/testsession/loadfixture?fixture=<path>`: Loads a fixture into an existing test state.
Expand All @@ -59,15 +59,15 @@ While you can use the interface to set the test session state,
it can be useful to set them programmatically through query parameters
on "dev/testsession/start":

* `fixture`: Loads a YAML fixture in the format generally accepted by `SapphireTest`
(see [fixture format docs](http://doc.silverstripe.org/en/developer_guides/testing/fixtures/)).
* `fixture`: Loads a YAML fixture in the format generally accepted by `SapphireTest`
(see [fixture format docs](http://doc.silverstripe.org/en/developer_guides/testing/fixtures/)).
The path should be relative to the webroot.
* `createDatabase`: Create a temporary database.
* `importDatabasePath`: Absolute path to a database dump to load into a newly created temporary database.
* `importDatabaseFilename`: File name for a database dump to load, relative to `TestSessionController.database_templates_path`
* `requireDefaultRecords`: Include default records as defined on the model classes (in PHP)
* `database`: Set an alternative database name in the current
browser session as a cookie. Does not actually create the database,
* `database`: Set an alternative database name in the current
browser session as a cookie. Does not actually create the database,
that's usually handled by `SapphireTest::create_temp_db()`.
Note: The database names are limited to a specific naming convention as a security measure:
The "ss_tmpdb" prefix and a random sequence of seven digits.
Expand All @@ -76,9 +76,9 @@ on "dev/testsession/start":
* `datetime`: Sets a simulated date used for all framework operations.
Format as "yyyy-MM-dd HH:mm:ss" (Example: "2012-12-31 18:40:59").
* `globalTestSession`: Activate test session independently of the current browser session,
effectively setting the site into test session mode for all users across different browsers.
Only available in "dev" mode. For example, create a global test session in Chrome, then you can share
the session data in Firefox. But if you have started a non-global session in a browser before starting
effectively setting the site into test session mode for all users across different browsers.
Only available in "dev" mode. For example, create a global test session in Chrome, then you can share
the session data in Firefox. But if you have started a non-global session in a browser before starting
a global session somewhere else, that non-global session will take priority in that browser.

Example usage with parameters:
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"silverstripe/framework": "^4@dev",
"silverstripe/vendor-plugin": "^1.3"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.5"
},
"extra": {
"branch-alias": {
"2.x-dev": "2.2.x-dev"
},
"expose": [
"client"
]
Expand Down
2 changes: 2 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<ruleset name="SilverStripe">
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>

<file>src</file>

<!-- base rules are PSR-2 -->
<rule ref="PSR2" >
<!-- Current exclusions -->
Expand Down

0 comments on commit a1e8643

Please sign in to comment.