-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into cmsp-480-vdp-readme-update
- Loading branch information
Showing
19 changed files
with
465 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Linting & Test | ||
on: [push] | ||
jobs: | ||
validate-readme-spacing: | ||
name: Validate README Spacing | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: pantheon-systems/validate-readme-spacing@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Lint and Test | ||
on: push | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
name: Lint | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/vendor | ||
key: test-lint-dependencies-{{ checksum "composer.json" }} | ||
restore-keys: test-lint-dependencies-{{ checksum "composer.json" }} | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.0' | ||
- name: Install dependencies | ||
run: composer install -n --prefer-dist | ||
- name: Run PHP Lint | ||
run: composer phpcs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
main(){ | ||
export TERMINUS_HIDE_GIT_MODE_WARNING=1 | ||
local DIRNAME=$(dirname "$0") | ||
|
||
if [ -z "${TERMINUS_SITE}" ]; then | ||
echo "TERMINUS_SITE environment variable must be set" | ||
exit 1 | ||
fi | ||
|
||
if ! terminus whoami > /dev/null; then | ||
if [ -z "${TERMINUS_TOKEN}" ]; then | ||
echo "TERMINUS_TOKEN environment variable must be set or terminus already logged in." | ||
exit 1 | ||
fi | ||
terminus auth:login --machine-token="${TERMINUS_TOKEN}" | ||
fi | ||
|
||
# Use find to locate the file with a case-insensitive search | ||
README_FILE_PATH=$(find ${DIRNAME}/.. -iname "readme.txt" -print -quit) | ||
if [[ -z "$README_FILE_PATH" ]]; then | ||
echo "readme.txt not found." | ||
exit 1 | ||
fi | ||
|
||
local TESTED_UP_TO | ||
TESTED_UP_TO=$(grep -i "Tested up to:" "${README_FILE_PATH}" | tr -d '\r\n' | awk -F ': ' '{ print $2 }') | ||
echo "Tested Up To: ${TESTED_UP_TO}" | ||
local FIXTURE_VERSION | ||
FIXTURE_VERSION=$(terminus wp "${TERMINUS_SITE}.dev" -- core version) | ||
echo "Fixture Version: ${FIXTURE_VERSION}" | ||
|
||
if ! php -r "exit(version_compare('${TESTED_UP_TO}', '${FIXTURE_VERSION}'));"; then | ||
echo "${FIXTURE_VERSION} is less than ${TESTED_UP_TO}" | ||
echo "Please update ${TERMINUS_SITE} to at least WordPress ${TESTED_UP_TO}" | ||
exit 1 | ||
fi | ||
} | ||
|
||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.