Skip to content

Commit

Permalink
Update structure follow scaffold 4.6.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
tannguyen04 authored and AlexSkrypnyk committed Jan 23, 2024
1 parent c8fd28f commit 5e41a1b
Show file tree
Hide file tree
Showing 23 changed files with 527 additions and 343 deletions.
39 changes: 33 additions & 6 deletions .ahoy.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,48 @@
#
# Ahoy configuration file.
# http://www.ahoycli.com/
#
# Provides development experience shortcuts.
---
ahoyapi: v2

commands:

build:
usage: Build or rebuild the project.
cmd: ./.circleci/build.sh
cmd: |
ahoy build-codebase
ahoy start-server
ahoy provision
build-codebase:
usage: Build the codebase.
cmd: ./.devtools/build-codebase.sh

start-server:
usage: Start built-in PHP-server.
cmd: ./.devtools/start-server.sh

provision:
usage: Provision a website.
cmd: ./.devtools/provision.sh

lint:
usage: Lint code.
cmd: ./.circleci/lint.sh
cmd: |
pushd "build" >/dev/null || exit 1
vendor/bin/phpcs
vendor/bin/phpstan
vendor/bin/rector --clear-cache --dry-run
vendor/bin/phpmd . text phpmd.xml
vendor/bin/twigcs
popd >/dev/null || exit 1
lint-fix:
usage: Fix coding standards.
cmd: |
pushd "build" >/dev/null || exit 1
vendor/bin/rector --clear-cache
vendor/bin/phpcbf
popd >/dev/null || exit 1
test:
usage: Run all tests.
cmd: ./.circleci/test.sh
cmd: ./.devtools/test.sh
197 changes: 0 additions & 197 deletions .circleci/build.sh

This file was deleted.

63 changes: 56 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# @see https://github.com/AlexSkrypnyk/drupal_module_scaffold
# @see https://github.com/AlexSkrypnyk/drupal_extension_scaffold
version: 2

aliases:
# SSH deployment key fingerprint from CircleCI App -> Project -> Settings -> SSH Permissions.
# Replace the value for your project.
# Replace with the value used for your project.
- &deploy_ssh_fingerprint "2d:71:4d:aa:4d:34:38:b5:8f:af:ca:3b:d4:82:6a:21"

# Configuration for shared runner containers, applied to each job.
- &container_config
working_directory: ~/project
docker:
Expand All @@ -12,14 +15,60 @@ aliases:
job-build: &job-build
steps:
- checkout
- run: .circleci/build.sh
- run: .circleci/lint.sh
- run: .circleci/test.sh

- run:
name: Build the codebase
command: .devtools/build-codebase.sh

- run:
name: Start built-in PHP server
command: .devtools/start-server.sh

- run:
name: Provision site
command: .devtools/provision.sh

- run:
command: .circleci/process-artifacts.sh
name: Lint code with PHPCS
command: vendor/bin/phpcs || [ "${CI_PHPCS_IGNORE_FAILURE:-0}" -eq 1 ]
working_directory: build

- run:
name: Lint code with PHPStan
command: vendor/bin/phpstan || [ "${CI_PHPSTAN_IGNORE_FAILURE:-0}" -eq 1 ]
working_directory: build

- run:
name: Lint code with Rector
command: vendor/bin/rector --clear-cache --dry-run || [ "${CI_RECTOR_IGNORE_FAILURE:-0}" -eq 1 ]
working_directory: build

- run:
name: Lint code with PHPMD
command: vendor/bin/phpmd . text phpmd.xml || [ "${CI_PHPMD_IGNORE_FAILURE:-0}" -eq 1 ]
working_directory: build

- run:
name: Lint code with Twigcs
command: vendor/bin/twigcs || [ "${CI_TWIGCS_IGNORE_FAILURE:-0}" -eq 1 ]
working_directory: build

- run:
name: Run tests
command: .devtools/test.sh || [ "${CI_TEST_IGNORE_FAILURE:-0}" -eq 1 ]

- run:
name: Process artifacts
command: |
if [ -d "build/web/sites/simpletest/browser_output" ]; then
mkdir -p /tmp/artifacts/simpletest
cp -Rf "build/web/sites/simpletest/browser_output/." /tmp/artifacts/simpletest
fi
when: always

- store_test_results:
path: /tmp/test_results

- store_artifacts:
path: /tmp/artifacts

Expand Down Expand Up @@ -71,7 +120,7 @@ jobs:
- add_ssh_keys:
fingerprints:
- *deploy_ssh_fingerprint
- run: DEPLOY_BRANCH=${DEPLOY_BRANCH:-${CIRCLE_BRANCH}} .circleci/deploy.sh
- run: DEPLOY_BRANCH=${DEPLOY_BRANCH:-${CIRCLE_BRANCH}} .devtools/deploy.sh

workflows:
version: 2
Expand Down
23 changes: 0 additions & 23 deletions .circleci/install-dependencies.sh

This file was deleted.

30 changes: 0 additions & 30 deletions .circleci/lint.sh

This file was deleted.

Loading

0 comments on commit 5e41a1b

Please sign in to comment.