-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/DIGITAL-36-validate-action' into feature/digita…
…l-27
- Loading branch information
Showing
12 changed files
with
187 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Run validation with RoboValidate | ||
|
||
on: | ||
# Run on any branch so validate branch can always run. | ||
push: | ||
# Commit message validation requires a target branch which is only available in a PR. | ||
pull_request: | ||
|
||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.3' | ||
tools: composer:v2 | ||
# https://github.com/shivammathur/setup-php?tab=readme-ov-file#disable-coverage | ||
coverage: none | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache Composer dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer | ||
|
||
- name: Install Composer dependencies and initialize Robo | ||
run: | | ||
composer install --ignore-platform-reqs --optimize-autoloader --no-progress --no-ansi | ||
# If a Robo command exits with a failure and a RoboFile.php does not exist | ||
# a warning about 'Robo is not initialized here. Please run `robo init` to create a new RoboFile.' | ||
# will be created, which might make users think that is what the error was caused by. | ||
if [ ! -f "RoboFile.php" ]; then | ||
vendor/bin/robo init | ||
fi | ||
- name: Validate a change to any branch | ||
if: github.event_name == 'push' | ||
run: | | ||
# Initialize status variables to 0 | ||
status1=0 | ||
status2=0 | ||
status3=0 | ||
# Run all commands and capture their exit statuses | ||
vendor/bin/robo validate:branch-name || status1=$? || status1=0 | ||
vendor/bin/robo validate:composer-lock || status3=$? || status3=0 | ||
vendor/bin/robo validate:coding-standards || status2=$? || status2=0 | ||
# Exit with a non-zero status if any command failed | ||
if [ "$status1" -ne 0 ] || [ "$status2" -ne 0 ] || [ "$status3" -ne 0 ]; then | ||
exit 1 | ||
fi | ||
- name: Validate pull requests | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
vendor/bin/robo validate:commit-messages --target-branch="${{ github.base_ref }}" --current-branch="${{ github.head_ref }}" |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,24 @@ | ||
# Automatically Generated from 'robo validate:init-robo-yml'. | ||
# See ./vendor/mattsqd/robovalidate/robo.example.yml for additional context. | ||
command: | ||
validate: | ||
options: | ||
project-id: DIGITAL | ||
branch-name: | ||
options: | ||
# These refer to all the possible branch names. There are 4 different types and they will be | ||
# described below. If you'd like to override any of these, you must put all back in that you'd like to | ||
# use, they will not be merged together. | ||
valid-branch-names: | ||
# Matches a branch named 'develop'. | ||
- 'explicit|develop' | ||
# Matches a branch named 'main'. | ||
- 'explicit|main' | ||
# Matches a custom regular expression found in $pattern. | ||
- 'custom|' | ||
# Matches a branch like: hotfix/2.1.3. | ||
- 'semantic|hotfix' | ||
# Matches a branch like (the last number MUST be a 0): release/2.1.0. | ||
- 'semantic_end_0|release' | ||
# Matches a branch named 'stage' (MOD FROM DEFAULTS). | ||
- 'explicit|stage' |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# Main theme library. | ||
global: | ||
js: | ||
static/dist/js/main.js: { minified: true } | ||
static/dist/js/uswds.js: {} | ||
static/dist/js/uswds-init.js: {} | ||
static/dist/js/main.min.js: { minified: true } | ||
static/dist/js/uswds.min.js: { minified: true } | ||
static/dist/js/uswds-init.min.js: { minified: true } | ||
css: | ||
base: | ||
static/dist/styles.css: { minified: true } | ||
static/dist/styles.min.css: { minified: true } |
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Functions to support theming in the Digital.gov theme. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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