Skip to content

Commit

Permalink
CircleCI: Use offical CircleCI PHP orb and next-gen docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
tangrufus committed May 17, 2020
1 parent 339533f commit ec0e7c6
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
version: 2.1

orbs:
bedrock:
executors:
php-latest:
docker:
- image: 'circleci/php:latest'
php-73:
docker:
- image: 'circleci/php:7.3-stretch'
php-72:
docker:
- image: 'circleci/php:7.2-stretch'
php-71:
docker:
- image: 'circleci/php:7.1-stretch'
jobs:
build-php:
parameters:
executor:
type: executor
executor: << parameters.executor >>
steps:
- run: php -v
- checkout
- restore_cache:
keys:
- composer-v1-{{ checksum "composer.lock" }}
- composer-v1-
- run: composer install -n --prefer-dist
- run: composer test
- save_cache:
key: composer-v1-{{ checksum "composer.lock" }}
paths:
- vendor
php: circleci/php@0.1

# To be removed after https://github.com/CircleCI-Public/php-orb/pull/11
executors:
default:
description: The official next-gen CircleCI PHP Docker image.
parameters:
tag:
description: The `cimg/php` Docker image version tag.
type: string
docker:
- image: "cimg/php:<< parameters.tag >>"

# To be removed after https://github.com/CircleCI-Public/php-orb/issues/23
jobs:
build-php:
parameters:
version:
default: "7.4"
description: The `cimg/php` Docker image version tag.
type: string
executor:
name: default
tag: << parameters.version >>
steps:
# Because squizlabs/php_codesniffer requires ext-simplexml.
# To be removed after https://github.com/CircleCI-Public/cimg-php/pull/51
- run: sudo apt-get update
- run: sudo apt-get install -y php<< parameters.version >>-xml
- run: php -v
- run: composer --version
# To be removed after https://github.com/CircleCI-Public/cimg-php/pull/52
- run: mkdir -p $(composer global config cache-dir --absolute)
- checkout
- php/load-cache:
key: v1
- run: composer install -n --prefer-dist
- run: composer test
- php/save-cache:
key: v1

workflows:
build:
jobs:
- bedrock/build-php:
name: build-php-latest
executor: bedrock/php-latest
- bedrock/build-php:
name: build-php-73
executor: bedrock/php-73
- bedrock/build-php:
name: build-php-72
executor: bedrock/php-72
- bedrock/build-php:
name: build-php-71
executor: bedrock/php-71
- build-php:
name: build-php-<< matrix.version >>
matrix:
parameters:
version: ["7.4", "7.3", "7.2"]

0 comments on commit ec0e7c6

Please sign in to comment.