Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/auto-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: AutoReview

on:
push:
branches: [ main, master ]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why the main branch is added in the branches setting?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, there is no reason.

I would like however to rename master to main at some point, allowing the two will allow to do that any time without any issue. Note that the other added workflow have the same too

pull_request: ~

jobs:
composer-validate:
runs-on: ubuntu-latest
name: Composer Validate
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer
coverage: none

- run: make composer_validate


# This is a "trick", a meta task which does not change, and we can use in
# the protected branch rules as opposed to the tests one above which
# may change regularly.
validate-autoreview:
name: AutoReview tests status
runs-on: ubuntu-latest
needs:
- composer-validate
if: always()
steps:
- name: Successful run
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0

- name: Failing run
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ $(TARGET): vendor $(shell find bin/ shell/ src/ -type f) box.json.dist .git/HEAD
box compile
touch -c $@

.PHONY: composer_validate
composer_validate:
# TODO: the --strict flag should be used once the warnings are addressed.
composer validate --ansi

vendor: composer.lock
composer install
touch $@
Expand Down