|
1 | | -# Use the latest 2.1 version of CircleCI pipeline process engine. |
2 | | -# See: https://circleci.com/docs/configuration-reference |
3 | 1 | version: 2.1 |
| 2 | +orbs: |
| 3 | + browser-tools: circleci/[email protected] |
4 | 4 |
|
5 | | -# Define a job to be invoked later in a workflow. |
6 | | -# See: https://circleci.com/docs/configuration-reference/#jobs |
7 | | -jobs: |
8 | | - say-hello: |
9 | | - # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. |
10 | | - # See: https://circleci.com/docs/configuration-reference/#executor-job |
| 5 | +jobs: # a collection of steps |
| 6 | + dusk: # runs not using Workflows must have a `build` job as entry point |
| 7 | + docker: # run the steps with Docker |
| 8 | + - image: cimg/php:8.2.4-browsers # ...with this image as the primary container; this is where all `steps` will run |
| 9 | + auth: |
| 10 | + username: mydockerhub-user |
| 11 | + password: $DOCKERHUB_PASSWORD # context / project UI env-var reference |
| 12 | + working_directory: ~/laravel # directory where steps will run |
| 13 | + steps: # a set of executable commands |
| 14 | + - checkout # special step to check out source code to working directory |
| 15 | + - run: sudo pecl install pcov |
| 16 | + - run: sudo composer selfupdate |
| 17 | + - restore_cache: # special step to restore the dependency cache if `composer.lock` does not change |
| 18 | + keys: |
| 19 | + - composer-v1-{{ checksum "composer.lock" }} |
| 20 | + # fallback to using the latest cache if no exact match is found (See https://circleci.com/docs/2.0/caching/) |
| 21 | + - composer-v1- |
| 22 | + - run: composer install -n --prefer-dist |
| 23 | + - save_cache: # special step to save the dependency cache with the `composer.lock` cache key template |
| 24 | + key: composer-v1-{{ checksum "composer.lock" }} |
| 25 | + paths: |
| 26 | + - vendor |
| 27 | + - restore_cache: # special step to restore the dependency cache if `package-lock.json` does not change |
| 28 | + keys: |
| 29 | + - node-v1-{{ checksum "package-lock.json" }} |
| 30 | + # fallback to using the latest cache if no exact match is found (See https://circleci.com/docs/2.0/caching/) |
| 31 | + - node-v1- |
| 32 | + - run: npm ci |
| 33 | + - save_cache: # special step to save the dependency cache with the `package-lock.json` cache key template |
| 34 | + key: node-v1-{{ checksum "package-lock.json" }} |
| 35 | + paths: |
| 36 | + - node_modules |
| 37 | + - run: touch database/testing.sqlite |
| 38 | + - run: touch database/database.sqlite |
| 39 | + - run: php artisan migrate --env=testing --database=sqlite_testing --force |
| 40 | + - run: php artisan dusk:chrome-driver 70 |
| 41 | + - run: wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb |
| 42 | + - run: sudo dpkg -i google-chrome-stable_current_amd64.deb |
| 43 | + - run: sudo apt-get install -f |
| 44 | + - run: npm run prod |
| 45 | + - run: |
| 46 | + name: Serve Application |
| 47 | + background: true |
| 48 | + command: php artisan serve |
| 49 | + - run: php artisan dusk |
| 50 | + - run: php artisan test |
| 51 | + - store_artifacts: |
| 52 | + path: ./tests/Browser/console |
| 53 | + destination: console |
| 54 | + - store_artifacts: |
| 55 | + path: ./tests/Browser/screenshots |
| 56 | + destination: screenshots |
| 57 | + # See https://circleci.com/docs/2.0/deployment-integrations/ for deploy examples |
| 58 | + resource_class: large |
| 59 | + |
| 60 | + vue-tests: |
11 | 61 | docker: |
12 | | - - image: cimg/base:stable |
13 | | - # Add steps to the job |
14 | | - # See: https://circleci.com/docs/configuration-reference/#steps |
| 62 | + - image: cimg/node:20.2.0 |
| 63 | + working_directory: ~/laravel |
15 | 64 | steps: |
16 | 65 | - checkout |
17 | | - - run: |
18 | | - name: "Say hello" |
19 | | - command: "echo Hello, World!" |
| 66 | + - restore_cache: |
| 67 | + keys: |
| 68 | + - node-v1-{{ checksum "package-lock.json" }} |
| 69 | + - node-v1- |
| 70 | + - run: npm ci |
| 71 | + - save_cache: |
| 72 | + key: node-v1-{{ checksum "package-lock.json" }} |
| 73 | + paths: |
| 74 | + - node_modules |
| 75 | + - run: npm run test # Assuming you have a "test" script in your package.json for running Vue tests |
20 | 76 |
|
21 | | -# Orchestrate jobs using workflows |
22 | | -# See: https://circleci.com/docs/configuration-reference/#workflows |
23 | 77 | workflows: |
24 | | - say-hello-workflow: |
| 78 | + version: 2 |
| 79 | + build-and-test: |
25 | 80 | jobs: |
26 | | - - say-hello |
| 81 | + - dusk |
| 82 | + - vue-tests |
0 commit comments