ci: use run script

This commit is contained in:
Oliver Davies 2022-01-13 22:09:58 +00:00
parent 21aa911fb4
commit 43a7205c85
2 changed files with 8 additions and 19 deletions

View file

@ -7,23 +7,7 @@ jobs:
phpcs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.4']
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v2
- name: Configure PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Install Composer dependencies
run: >
composer install --no-progress --no-suggest --prefer-dist \
--optimize-autoloader
- name: Run PHPCS
run: make phpcs
- run: ./run ci:test

7
run
View file

@ -10,6 +10,11 @@ function build {
docker image build . --tag ${DOCKER_TAG}
}
function ci:test {
build
test "${@}"
}
function help {
printf "%s <task> [args]\n\nTasks:\n" "${0}"
@ -20,7 +25,7 @@ function help {
function test {
# Run PHPUnit tests.
docker container run --rm -it \
docker container run --rm -t \
-v $(pwd):/app \
--entrypoint phpunit \
${DOCKER_TAG} "${@}"