|
1 | | -# PHP CircleCI 2.0 configuration file |
2 | | -# See: https://circleci.com/docs/2.0/language-php/ |
3 | | -version: 2 |
| 1 | +version: 2.1 |
4 | 2 |
|
5 | | -# Define a job to be invoked later in a workflow. |
6 | | -# See: https://circleci.com/docs/2.0/configuration-reference/#jobs |
7 | | -jobs: |
8 | | - build: |
9 | | - # Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub. |
10 | | - # See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor |
| 3 | +executors: |
| 4 | + php-executor: |
11 | 5 | docker: |
12 | | - # Specify the version you desire here |
13 | | - - image: cimg/php:8.2.20-node |
14 | | - |
15 | | - # Specify service dependencies here if necessary |
16 | | - # CircleCI maintains a library of pre-built images |
17 | | - # documented at https://circleci.com/docs/2.0/circleci-images/ |
18 | | - # Using the RAM variation mitigates I/O contention |
19 | | - # for database intensive operations. |
20 | | - # - image: circleci/mysql:5.7-ram |
21 | | - # |
22 | | - #- image: redis:2.8.19 |
| 6 | + - image: cimg/php:<<parameters.php-version>>-browsers |
| 7 | + - image: redis:alpine |
| 8 | + parameters: |
| 9 | + php-version: |
| 10 | + type: string |
| 11 | + default: "8.0" |
| 12 | + working_directory: ~/laravel-super-cache-invalidate |
23 | 13 |
|
24 | | - # Add steps to the job |
25 | | - # See: https://circleci.com/docs/2.0/configuration-reference/#steps |
| 14 | +jobs: |
| 15 | + test: |
| 16 | + parameters: |
| 17 | + php-version: |
| 18 | + type: string |
| 19 | + laravel-version: |
| 20 | + type: string |
| 21 | + executor: |
| 22 | + name: php-executor |
| 23 | + php-version: <<parameters.php-version>> |
26 | 24 | steps: |
27 | 25 | - checkout |
| 26 | + - run: |
| 27 | + name: Install Redis Extension |
| 28 | + command: | |
| 29 | + yes 'no' | sudo pecl install -f redis || true |
| 30 | + sudo docker-php-ext-enable redis.so |
| 31 | + #- run: |
| 32 | + # name: Update Composer |
| 33 | + # command: sudo composer self-update |
| 34 | + - run: |
| 35 | + name: Install Dependencies |
| 36 | + command: composer install --prefer-dist --no-interaction |
| 37 | + - run: |
| 38 | + name: Install Dependencies |
| 39 | + command: | |
| 40 | + sudo composer require "laravel/framework:^10.0" --no-update |
| 41 | + sudo composer install --prefer-dist --no-interaction |
| 42 | + - run: |
| 43 | + name: Prepare bootstrap/cache directory |
| 44 | + command: mkdir -p ./vendor/orchestra/testbench-core/laravel/bootstrap/cache && chmod -R 777 ./vendor/orchestra/testbench-core/laravel/bootstrap/cache |
28 | 45 |
|
29 | | - - run: sudo apt update -y && sudo apt-get install -y zip unzip # PHP CircleCI 2.0 Configuration File# PHP CircleCI 2.0 Configuration File sudo apt install zlib1g-dev libsqlite3-dev |
30 | | - - run: sudo docker-php-ext-install zip |
31 | | - #- run: sudo install-php-extensions redis |
32 | | - |
33 | | - # Download and cache dependencies |
34 | | - - restore_cache: |
35 | | - keys: |
36 | | - # "composer.lock" can be used if it is committed to the repo |
37 | | - - v1-dependencies-{{ checksum "composer.json" }} |
38 | | - # fallback to using the latest cache if no exact match is found |
39 | | - - v1-dependencies- |
40 | | - |
41 | | - - run: composer install -n --prefer-dist --ignore-platform-req=ext-redis |
42 | | - |
43 | | - - save_cache: |
44 | | - key: v1-dependencies-{{ checksum "composer.json" }} |
45 | | - paths: |
46 | | - - ./vendor |
47 | | - #- restore_cache: |
48 | | - # keys: |
49 | | - # - node-v1-{{ checksum "package.json" }} |
50 | | - # - node-v1- |
51 | | - - run: yarn install |
52 | | - #- save_cache: |
53 | | - # key: node-v1-{{ checksum "package.json" }} |
54 | | - # paths: |
55 | | - # - node_modules |
56 | | - |
57 | | - # prepare the database |
58 | | - #- run: touch storage/testing.sqlite |
59 | | - #- run: php artisan migrate --env=testing --database=sqlite_testing --force |
| 46 | + - run: |
| 47 | + name: Run Tests |
| 48 | + command: | |
| 49 | + vendor/bin/phpunit |
60 | 50 |
|
61 | | - # run tests with phpunit or codecept |
62 | | - #- run: ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover |
63 | | - - run: ./vendor/bin/phpunit |
| 51 | +workflows: |
| 52 | + version: 2 |
| 53 | + test: |
| 54 | + jobs: |
| 55 | + - test: |
| 56 | + name: PHP 8.2 + Laravel 10 |
| 57 | + php-version: "8.2" |
| 58 | + laravel-version: "10" |
| 59 | + - test: |
| 60 | + name: PHP 8.3 + Laravel 10 |
| 61 | + php-version: "8.3" |
| 62 | + laravel-version: "10" |
| 63 | + - test: |
| 64 | + name: PHP 8.4 + Laravel 10 |
| 65 | + php-version: "8.4" |
| 66 | + laravel-version: "10" |
0 commit comments