ci: use run script
This commit is contained in:
parent
21aa911fb4
commit
43a7205c85
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
|
@ -7,23 +7,7 @@ jobs:
|
||||||
phpcs:
|
phpcs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
php-version: ['7.4']
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Configure PHP ${{ matrix.php-version }}
|
- run: ./run ci:test
|
||||||
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
|
|
||||||
|
|
7
run
7
run
|
@ -10,6 +10,11 @@ function build {
|
||||||
docker image build . --tag ${DOCKER_TAG}
|
docker image build . --tag ${DOCKER_TAG}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ci:test {
|
||||||
|
build
|
||||||
|
test "${@}"
|
||||||
|
}
|
||||||
|
|
||||||
function help {
|
function help {
|
||||||
printf "%s <task> [args]\n\nTasks:\n" "${0}"
|
printf "%s <task> [args]\n\nTasks:\n" "${0}"
|
||||||
|
|
||||||
|
@ -20,7 +25,7 @@ function help {
|
||||||
|
|
||||||
function test {
|
function test {
|
||||||
# Run PHPUnit tests.
|
# Run PHPUnit tests.
|
||||||
docker container run --rm -it \
|
docker container run --rm -t \
|
||||||
-v $(pwd):/app \
|
-v $(pwd):/app \
|
||||||
--entrypoint phpunit \
|
--entrypoint phpunit \
|
||||||
${DOCKER_TAG} "${@}"
|
${DOCKER_TAG} "${@}"
|
||||||
|
|
Loading…
Reference in a new issue