2021-02-01 14:06:06 +01:00
|
|
|
version: 2
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
docker:
|
|
|
|
- image: penpotapp/devenv:latest
|
2022-11-03 10:35:19 +01:00
|
|
|
- image: cimg/postgres:14.5
|
2021-02-01 14:06:06 +01:00
|
|
|
environment:
|
|
|
|
POSTGRES_USER: penpot_test
|
|
|
|
POSTGRES_PASSWORD: penpot_test
|
2021-03-30 15:35:18 +02:00
|
|
|
POSTGRES_DB: penpot_test
|
2022-11-03 10:35:19 +01:00
|
|
|
- image: cimg/redis:7.0.5
|
2021-02-01 14:06:06 +01:00
|
|
|
|
|
|
|
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:
|
|
|
|
keys:
|
2021-05-28 13:50:42 +02:00
|
|
|
- v1-dependencies-{{ checksum "backend/deps.edn" }}-{{ checksum "frontend/deps.edn"}}-{{ checksum "common/deps.edn"}}
|
2021-02-01 14:06:06 +01:00
|
|
|
# fallback to using the latest cache if no exact match is found
|
|
|
|
- v1-dependencies-
|
|
|
|
|
2022-06-29 23:00:45 +02:00
|
|
|
- run: cd .clj-kondo && cat config.edn
|
2023-11-27 12:28:28 +01:00
|
|
|
- run: cat .cljfmt.edn
|
2023-11-29 16:22:56 +01:00
|
|
|
- run: clj-kondo --version
|
2022-06-29 23:00:45 +02:00
|
|
|
|
2024-01-05 13:43:38 +01:00
|
|
|
- run:
|
|
|
|
name: "fmt check backend [clj]"
|
|
|
|
working_directory: "./backend"
|
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
yarn run fmt:clj:check
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: "fmt check exporter [clj]"
|
|
|
|
working_directory: "./exporter"
|
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
yarn run fmt:clj:check
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: "fmt check common [clj]"
|
|
|
|
working_directory: "./common"
|
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
yarn run fmt:clj:check
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: "fmt check frontend [clj]"
|
|
|
|
working_directory: "./frontend"
|
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
yarn run fmt:clj:check
|
2022-11-03 10:35:19 +01:00
|
|
|
|
2021-06-18 10:25:17 +02:00
|
|
|
- run:
|
2023-11-29 16:22:56 +01:00
|
|
|
name: common lint
|
|
|
|
working_directory: "./common"
|
2021-11-18 16:59:53 +01:00
|
|
|
command: |
|
2023-11-29 16:22:56 +01:00
|
|
|
yarn install
|
2023-11-27 12:28:28 +01:00
|
|
|
yarn run lint:clj
|
2021-06-18 10:25:17 +02:00
|
|
|
|
|
|
|
- run:
|
2023-11-29 16:22:56 +01:00
|
|
|
name: frontend lint
|
2021-06-18 10:25:17 +02:00
|
|
|
working_directory: "./frontend"
|
2021-11-18 16:59:53 +01:00
|
|
|
command: |
|
2023-11-27 12:28:28 +01:00
|
|
|
yarn install
|
|
|
|
yarn run lint:scss
|
2023-11-29 16:22:56 +01:00
|
|
|
yarn run lint:clj
|
2021-02-01 14:06:06 +01:00
|
|
|
|
2022-11-03 10:35:19 +01:00
|
|
|
- run:
|
2023-11-29 16:22:56 +01:00
|
|
|
name: backend lint
|
|
|
|
working_directory: "./backend"
|
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
yarn run lint:clj
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: exporter lint
|
|
|
|
working_directory: "./exporter"
|
2022-11-03 10:35:19 +01:00
|
|
|
command: |
|
|
|
|
yarn install
|
2023-11-29 16:22:56 +01:00
|
|
|
yarn run lint:clj
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: "common tests"
|
|
|
|
working_directory: "./common"
|
|
|
|
command: |
|
2022-11-08 10:40:19 +01:00
|
|
|
yarn test
|
2024-04-24 15:41:12 +02:00
|
|
|
clojure -M:dev:test
|
2022-11-03 10:35:19 +01:00
|
|
|
|
2021-02-01 14:06:06 +01:00
|
|
|
- run:
|
2023-11-29 16:22:56 +01:00
|
|
|
name: "frontend tests"
|
|
|
|
working_directory: "./frontend"
|
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
yarn test
|
|
|
|
|
2024-05-09 13:17:12 +02:00
|
|
|
- run:
|
|
|
|
name: "frontend integration tests"
|
|
|
|
working_directory: "./frontend"
|
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
yarn run compile
|
|
|
|
clojure -M:dev:shadow-cljs compile main
|
|
|
|
yarn playwright install --with-deps chromium
|
|
|
|
yarn e2e:test
|
|
|
|
|
2023-11-29 16:22:56 +01:00
|
|
|
- run:
|
|
|
|
name: "backend tests"
|
2021-05-28 13:50:42 +02:00
|
|
|
working_directory: "./backend"
|
2022-11-03 10:35:19 +01:00
|
|
|
command: |
|
2022-11-08 10:40:19 +01:00
|
|
|
clojure -X:dev:test :patterns '["backend-tests.*-test"]'
|
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:
|
|
|
|
paths:
|
|
|
|
- ~/.m2
|
2021-05-28 13:50:42 +02:00
|
|
|
key: v1-dependencies-{{ checksum "backend/deps.edn" }}-{{ checksum "frontend/deps.edn"}}-{{ checksum "common/deps.edn"}}
|
2021-02-01 14:06:06 +01:00
|
|
|
|