2021-02-01 14:06:06 +01:00
|
|
|
version: 2
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
docker:
|
|
|
|
- image: penpotapp/devenv:latest
|
2022-03-18 13:13:04 +01:00
|
|
|
- image: cimg/postgres:13.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-03-18 13:13:04 +01:00
|
|
|
- image: cimg/redis:6.2.6
|
2021-02-01 14:06:06 +01:00
|
|
|
|
|
|
|
working_directory: ~/repo
|
2022-06-24 07:29:14 +02:00
|
|
|
resource_class: large
|
2021-02-01 14:06:06 +01:00
|
|
|
|
|
|
|
environment:
|
|
|
|
# Customize the JVM maximum heap limit
|
2021-02-01 16:59:19 +01:00
|
|
|
JVM_OPTS: -Xmx1g
|
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
|
|
|
|
|
2021-06-18 10:25:17 +02:00
|
|
|
- run:
|
|
|
|
name: common lint
|
|
|
|
working_directory: "./common"
|
2021-11-18 16:59:53 +01:00
|
|
|
command: |
|
|
|
|
clj-kondo --version
|
|
|
|
clj-kondo --parallel --lint src/
|
2021-06-18 10:25:17 +02:00
|
|
|
|
|
|
|
- run:
|
|
|
|
name: frontend lint
|
|
|
|
working_directory: "./frontend"
|
2021-11-18 16:59:53 +01:00
|
|
|
command: |
|
|
|
|
clj-kondo --version
|
|
|
|
clj-kondo --parallel --lint src/
|
2021-06-18 10:25:17 +02:00
|
|
|
|
2022-01-12 11:25:01 +01:00
|
|
|
- run:
|
|
|
|
name: frontend styles prettier
|
|
|
|
working_directory: "./frontend"
|
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
yarn run lint-scss
|
|
|
|
|
2021-02-01 14:06:06 +01:00
|
|
|
- run:
|
2021-02-01 16:59:19 +01:00
|
|
|
name: backend lint
|
2021-05-28 13:50:42 +02:00
|
|
|
working_directory: "./backend"
|
2021-11-18 16:59:53 +01:00
|
|
|
command: |
|
|
|
|
clj-kondo --version
|
|
|
|
clj-kondo --parallel --lint src/
|
2021-02-01 14:06:06 +01:00
|
|
|
|
2021-05-28 13:50:42 +02:00
|
|
|
# run backend test
|
2021-02-01 14:06:06 +01:00
|
|
|
- run:
|
2021-02-01 16:59:19 +01:00
|
|
|
name: backend test
|
2021-05-28 13:50:42 +02:00
|
|
|
working_directory: "./backend"
|
|
|
|
command: "clojure -X:dev:test"
|
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
|
|
|
|
2021-02-01 16:59:19 +01:00
|
|
|
- run:
|
|
|
|
name: frontend tests
|
2021-05-28 13:50:42 +02:00
|
|
|
working_directory: "./frontend"
|
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
clojure -M:dev:shadow-cljs compile test
|
|
|
|
node target/tests.js
|
|
|
|
|
|
|
|
environment:
|
2021-12-02 18:20:45 +01:00
|
|
|
PATH: /usr/local/nodejs/bin/:/usr/local/bin:/bin:/usr/bin
|
2021-05-28 13:50:42 +02:00
|
|
|
|
2022-01-03 09:10:18 +01:00
|
|
|
# - run:
|
|
|
|
# working_directory: "./common"
|
|
|
|
# name: common tests (cljs)
|
|
|
|
# command: |
|
|
|
|
# yarn install
|
|
|
|
# yarn run compile-test
|
|
|
|
# node target/test.js
|
|
|
|
#
|
|
|
|
# environment:
|
|
|
|
# PATH: /usr/local/nodejs/bin/:/usr/local/bin:/bin:/usr/bin
|
|
|
|
|
2021-05-28 13:50:42 +02:00
|
|
|
- run:
|
|
|
|
working_directory: "./common"
|
2022-01-03 09:10:18 +01:00
|
|
|
name: common tests (clj)
|
2021-02-01 16:59:19 +01:00
|
|
|
command: |
|
2021-05-28 13:50:42 +02:00
|
|
|
clojure -X:dev:test
|
|
|
|
|
2021-02-01 16:59:19 +01:00
|
|
|
environment:
|
2021-12-02 18:20:45 +01:00
|
|
|
PATH: /usr/local/nodejs/bin/:/usr/local/bin:/bin:/usr/bin
|
2021-02-01 16:59:19 +01:00
|
|
|
|
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
|
|
|
|