2024-10-28 16:01:38 +01:00
|
|
|
version: 2.1
|
2021-02-01 14:06:06 +01:00
|
|
|
jobs:
|
2024-10-28 16:01:38 +01:00
|
|
|
test-common:
|
2021-02-01 14:06:06 +01:00
|
|
|
docker:
|
|
|
|
- image: penpotapp/devenv:latest
|
|
|
|
|
|
|
|
working_directory: ~/repo
|
2023-12-04 19:13:14 +01:00
|
|
|
resource_class: medium+
|
2021-02-01 14:06:06 +01:00
|
|
|
|
|
|
|
environment:
|
2023-12-04 19:13:14 +01:00
|
|
|
JAVA_OPTS: -Xmx4g -Xms100m -XX:+UseSerialGC
|
|
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
2021-02-01 14:06:06 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
# Download and cache dependencies
|
|
|
|
- restore_cache:
|
2024-08-05 11:29:14 +02:00
|
|
|
keys:
|
2024-10-28 16:01:38 +01:00
|
|
|
- v1-dependencies-{{ checksum "common/deps.edn"}}
|
2022-06-29 23:00:45 +02:00
|
|
|
|
2024-01-05 13:43:38 +01:00
|
|
|
- run:
|
2024-10-28 16:01:38 +01:00
|
|
|
name: "fmt check & linter"
|
|
|
|
working_directory: "./common"
|
2024-01-05 13:43:38 +01:00
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
yarn run fmt:clj:check
|
2024-10-28 16:01:38 +01:00
|
|
|
yarn run lint:clj
|
2024-01-05 13:43:38 +01:00
|
|
|
|
|
|
|
- run:
|
2024-10-28 16:01:38 +01:00
|
|
|
name: "JVM tests"
|
2024-01-05 13:43:38 +01:00
|
|
|
working_directory: "./common"
|
|
|
|
command: |
|
2024-10-28 16:01:38 +01:00
|
|
|
clojure -M:dev:test
|
2024-01-05 13:43:38 +01:00
|
|
|
|
2024-11-18 14:55:13 +01:00
|
|
|
- run:
|
|
|
|
name: "NODE tests"
|
|
|
|
working_directory: "./common"
|
|
|
|
command: |
|
|
|
|
yarn run test
|
|
|
|
|
2024-10-28 16:01:38 +01:00
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- ~/.m2
|
|
|
|
key: v1-dependencies-{{ checksum "common/deps.edn"}}
|
2022-11-03 10:35:19 +01:00
|
|
|
|
2024-10-28 16:01:38 +01:00
|
|
|
test-frontend:
|
|
|
|
docker:
|
|
|
|
- image: penpotapp/devenv:latest
|
2021-02-01 14:06:06 +01:00
|
|
|
|
2024-10-28 16:01:38 +01:00
|
|
|
working_directory: ~/repo
|
|
|
|
resource_class: medium+
|
|
|
|
|
|
|
|
environment:
|
|
|
|
JAVA_OPTS: -Xmx4g -Xms100m -XX:+UseSerialGC
|
|
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
# Download and cache dependencies
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- v1-dependencies-{{ checksum "frontend/deps.edn"}}
|
2023-11-29 16:22:56 +01:00
|
|
|
|
2024-10-29 19:06:36 +01:00
|
|
|
- run:
|
|
|
|
name: "prepopulate linter cache"
|
|
|
|
working_directory: "./common"
|
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
yarn run lint:clj
|
|
|
|
|
2023-11-29 16:22:56 +01:00
|
|
|
- run:
|
2024-10-28 16:01:38 +01:00
|
|
|
name: "fmt check & linter"
|
|
|
|
working_directory: "./frontend"
|
2022-11-03 10:35:19 +01:00
|
|
|
command: |
|
|
|
|
yarn install
|
2024-10-28 16:01:38 +01:00
|
|
|
yarn run fmt:clj:check
|
|
|
|
yarn run fmt:js:check
|
|
|
|
yarn run lint:scss
|
2023-11-29 16:22:56 +01:00
|
|
|
yarn run lint:clj
|
|
|
|
|
|
|
|
- run:
|
2024-10-28 16:01:38 +01:00
|
|
|
name: "unit tests"
|
2023-11-29 16:22:56 +01:00
|
|
|
working_directory: "./frontend"
|
|
|
|
command: |
|
|
|
|
yarn install
|
2024-10-31 16:43:20 +01:00
|
|
|
yarn run test
|
2023-11-29 16:22:56 +01:00
|
|
|
|
2024-10-29 19:06:36 +01:00
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- ~/.m2
|
|
|
|
key: v1-dependencies-{{ checksum "frontend/deps.edn"}}
|
|
|
|
|
|
|
|
test-integration:
|
|
|
|
docker:
|
|
|
|
- image: penpotapp/devenv:latest
|
|
|
|
|
|
|
|
working_directory: ~/repo
|
2024-11-01 09:52:39 +01:00
|
|
|
resource_class: large
|
2024-10-29 19:06:36 +01:00
|
|
|
|
|
|
|
environment:
|
2024-11-01 09:52:39 +01:00
|
|
|
JAVA_OPTS: -Xmx6g -Xms2g
|
2024-10-29 19:06:36 +01:00
|
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
# Download and cache dependencies
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- v1-dependencies-{{ checksum "frontend/deps.edn"}}
|
|
|
|
|
2024-05-23 13:21:15 +02:00
|
|
|
- run:
|
2024-10-28 16:01:38 +01:00
|
|
|
name: "integration tests"
|
2024-05-23 13:21:15 +02:00
|
|
|
working_directory: "./frontend"
|
|
|
|
command: |
|
|
|
|
yarn install
|
2024-08-05 11:29:14 +02:00
|
|
|
yarn run build:app:assets
|
2024-10-18 16:43:50 +02:00
|
|
|
yarn run build:app
|
2024-10-31 16:43:20 +01:00
|
|
|
yarn run build:app:libs
|
2024-10-18 16:43:50 +02:00
|
|
|
yarn run playwright install --with-deps chromium
|
2024-11-01 09:52:39 +01:00
|
|
|
yarn run test:e2e -x --workers=4
|
2024-05-09 13:17:12 +02:00
|
|
|
|
2024-10-28 16:01:38 +01:00
|
|
|
test-backend:
|
|
|
|
docker:
|
|
|
|
- image: penpotapp/devenv:latest
|
|
|
|
- image: cimg/postgres:14.5
|
|
|
|
environment:
|
|
|
|
POSTGRES_USER: penpot_test
|
|
|
|
POSTGRES_PASSWORD: penpot_test
|
|
|
|
POSTGRES_DB: penpot_test
|
|
|
|
- image: cimg/redis:7.0.5
|
|
|
|
|
|
|
|
working_directory: ~/repo
|
|
|
|
resource_class: medium+
|
|
|
|
|
|
|
|
environment:
|
|
|
|
JAVA_OPTS: -Xmx4g -Xms100m -XX:+UseSerialGC
|
|
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- v1-dependencies-{{ checksum "backend/deps.edn" }}
|
|
|
|
|
2024-10-29 19:06:36 +01:00
|
|
|
- run:
|
|
|
|
name: "prepopulate linter cache"
|
|
|
|
working_directory: "./common"
|
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
yarn run lint:clj
|
|
|
|
|
2023-11-29 16:22:56 +01:00
|
|
|
- run:
|
2024-10-28 16:01:38 +01:00
|
|
|
name: "fmt check & linter"
|
|
|
|
working_directory: "./backend"
|
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
yarn run fmt:clj:check
|
|
|
|
yarn run lint:clj
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: "tests"
|
2021-05-28 13:50:42 +02:00
|
|
|
working_directory: "./backend"
|
2022-11-03 10:35:19 +01:00
|
|
|
command: |
|
2024-10-29 09:08:25 +01:00
|
|
|
clojure -M:dev:test --reporter kaocha.report/documentation
|
2022-11-03 10:35:19 +01:00
|
|
|
|
2021-02-01 14:06:06 +01:00
|
|
|
environment:
|
2021-03-30 15:35:18 +02:00
|
|
|
PENPOT_TEST_DATABASE_URI: "postgresql://localhost/penpot_test"
|
|
|
|
PENPOT_TEST_DATABASE_USERNAME: penpot_test
|
|
|
|
PENPOT_TEST_DATABASE_PASSWORD: penpot_test
|
|
|
|
PENPOT_TEST_REDIS_URI: "redis://localhost/1"
|
2021-02-01 14:06:06 +01:00
|
|
|
|
|
|
|
- save_cache:
|
2024-08-05 11:29:14 +02:00
|
|
|
paths:
|
|
|
|
- ~/.m2
|
2024-10-28 16:01:38 +01:00
|
|
|
key: v1-dependencies-{{ checksum "backend/deps.edn" }}
|
|
|
|
|
|
|
|
test-exporter:
|
|
|
|
docker:
|
|
|
|
- image: penpotapp/devenv:latest
|
|
|
|
|
|
|
|
working_directory: ~/repo
|
|
|
|
resource_class: medium+
|
|
|
|
|
|
|
|
environment:
|
|
|
|
JAVA_OPTS: -Xmx4g -Xms100m -XX:+UseSerialGC
|
|
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
2024-10-29 19:06:36 +01:00
|
|
|
- run:
|
|
|
|
name: "prepopulate linter cache"
|
|
|
|
working_directory: "./common"
|
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
yarn run lint:clj
|
2024-10-28 16:01:38 +01:00
|
|
|
|
|
|
|
- run:
|
|
|
|
name: "fmt check & linter"
|
|
|
|
working_directory: "./exporter"
|
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
yarn run fmt:clj:check
|
|
|
|
yarn run lint:clj
|
|
|
|
|
2024-11-25 13:07:36 +01:00
|
|
|
test-render-wasm:
|
|
|
|
docker:
|
|
|
|
- image: penpotapp/devenv:latest
|
|
|
|
|
|
|
|
working_directory: ~/repo
|
|
|
|
resource_class: medium+
|
|
|
|
environment:
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: "fmt check"
|
|
|
|
working_directory: "./render-wasm"
|
|
|
|
command: |
|
|
|
|
cargo fmt --check
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: "cargo tests"
|
|
|
|
working_directory: "./render-wasm"
|
|
|
|
command: |
|
2024-12-11 10:47:43 +01:00
|
|
|
./test
|
2024-11-25 13:07:36 +01:00
|
|
|
|
2024-10-28 16:01:38 +01:00
|
|
|
workflows:
|
|
|
|
penpot:
|
|
|
|
jobs:
|
|
|
|
- test-frontend
|
2024-10-29 19:06:36 +01:00
|
|
|
- test-integration
|
2024-10-28 16:01:38 +01:00
|
|
|
- test-backend
|
|
|
|
- test-common
|
|
|
|
- test-exporter
|
2024-11-25 13:07:36 +01:00
|
|
|
- test-render-wasm
|