Skip to content

Commit 6227b1c

Browse files
authored
Merge pull request #14 from dof-dss/development
Unity modules release
2 parents 05b2031 + 67d866c commit 6227b1c

File tree

3 files changed

+119
-0
lines changed

3 files changed

+119
-0
lines changed

.circleci/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# CircleCI service overview
2+
3+
This service runs a number of discrete testing steps, defined as jobs in `.circleci/config.yml`.
4+
5+
See https://circleci.com/docs/2.0 for configuration file/language specifications.
6+
7+
Environment variable usage is encouraged to safeguard sensitive values, but usage can be fiddly as interpolation in parts of the config file will work in some parts but not others.
8+
9+
## Running locally
10+
11+
It is possible to debug/run the pipeline locally using the CircleCI Local CLI tool.
12+
13+
See https://circleci.com/docs/2.0/local-cli/ for installation and further details.
14+
15+
> TL;DR:
16+
17+
- Install with: `brew install circleci`
18+
- Run individual jobs like this: `circleci local execute --job YOUR_JOB_NAME -e GITHUB_TOKEN=YOUR-TOKEN-VALUE -e ANOTHER_VAR=another_value`
19+
- Note how environmental variables from CircleCI are not accessible outside of that platform. You need to pass them in as per above when running locally. That might be tricky if you don't have a certain key value; CircleCI's environment variable browser will not show you the raw value once the variable has been created.
20+
- Features such as parallelism, workspace sharing and directory caching won't work. You may need to adjust your job's execution steps to compensate for this.
21+
22+
## Interaction with other supporting repos/services
23+
24+
This is a supporting project for the NIDirect site. It provides basic, but helpful, checks to trap simple issues earlier on. The full site test pipeline at https://github.com/dof-dss/nidirect-drupal will run whenever a new version of this project is added to the `composer.lock` file of the main repo.

.circleci/config.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# PHP CircleCI 2.0 configuration file
2+
#
3+
# Check https://circleci.com/docs/2.0/language-php/ for more details
4+
version: 2.1
5+
6+
jobs:
7+
# Test that coding standards fit drupal.org definitions.
8+
coding_standards:
9+
docker:
10+
- image: circleci/php:8.0-apache-browsers
11+
steps:
12+
- checkout
13+
- run:
14+
name: Fetch phpcs and dependencies
15+
command: |
16+
composer require drupal/coder --prefer-stable --no-interaction --optimize-autoloader
17+
composer require slevomat/coding-standard --prefer-stable --no-interaction --optimize-autoloader
18+
# Move vendor directory up a level as we don't want to code-check all of that.
19+
mv vendor ../
20+
- run:
21+
name: Fetch phpcs convenience script
22+
command: |
23+
curl https://raw.githubusercontent.com/dof-dss/nidirect-drupal/development/phpcs.sh -o /home/circleci/project/phpcs.sh
24+
chmod +x /home/circleci/project/phpcs.sh
25+
- run:
26+
name: PHPCS analysis
27+
command: /home/circleci/project/phpcs.sh /home/circleci "/home/circleci/project"
28+
29+
deprecated_code:
30+
docker:
31+
- image: circleci/php:8.0-apache-browsers
32+
steps:
33+
- checkout:
34+
path: /home/circleci/origins_modules
35+
- run:
36+
name: Add OS and PHP extensions/config
37+
command: |
38+
sudo cp /home/circleci/origins_modules/.circleci/docker-php-circleci.ini /usr/local/etc/php/conf.d/
39+
sudo apt --allow-releaseinfo-change update
40+
sudo apt install -y libpng-dev
41+
sudo docker-php-ext-install gd
42+
- run:
43+
name: Fetch latest Drupal version
44+
command: |
45+
cd /home/circleci
46+
composer create-project drupal-composer/drupal-project:9.x-dev /home/circleci/project --no-interaction
47+
- run:
48+
name: Download dependent contrib modules.
49+
command: |
50+
cd /home/circleci/project
51+
composer require drupal/entity_embed mglaman/drupal-check:1.3.0 composer/xdebug-handler:2.0.1 --no-interaction
52+
- run:
53+
name: Move custom code into position
54+
command: mv /home/circleci/origins_modules /home/circleci/project/web/modules/origins
55+
- run:
56+
name: Deprecated code check
57+
command: |
58+
cd /home/circleci/project/web
59+
../vendor/bin/drupal-check modules/origins -e "*/tests/*"
60+
61+
workflows:
62+
version: 2
63+
static_analysis:
64+
jobs:
65+
- coding_standards
66+
- deprecated_code

.circleci/docker-php-circleci.ini

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
;;;;;;;;;;;;;;;;;;;
2+
; Resource Limits ;
3+
;;;;;;;;;;;;;;;;;;;
4+
5+
; Maximum execution time of each script, in seconds
6+
; http://php.net/max-execution-time
7+
; Note: This directive is hardcoded to 0 for the CLI SAPI
8+
max_execution_time = 60
9+
10+
; Maximum amount of time each script may spend parsing request data. It's a good
11+
; idea to limit this time on productions servers in order to eliminate unexpectedly
12+
; long running scripts.
13+
; Note: This directive is hardcoded to -1 for the CLI SAPI
14+
; Default Value: -1 (Unlimited)
15+
; Development Value: 60 (60 seconds)
16+
; Production Value: 60 (60 seconds)
17+
; http://php.net/max-input-time
18+
max_input_time = 60
19+
20+
; Maximum input variable nesting level
21+
; http://php.net/max-input-nesting-level
22+
;max_input_nesting_level = 64
23+
24+
; How many GET/POST/COOKIE input variables may be accepted
25+
;max_input_vars = 1000
26+
27+
; Maximum amount of memory a script may consume (128MB)
28+
; http://php.net/memory-limit
29+
memory_limit = -1M

0 commit comments

Comments
 (0)