mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 06:58:58 -05:00
🎉 Add circle CI (for backend).
This commit is contained in:
parent
240de28567
commit
b3f9c3d27e
4 changed files with 68 additions and 7 deletions
57
.circleci/config.yml
Normal file
57
.circleci/config.yml
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
version: 2
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
docker:
|
||||||
|
# specify the version you desire here
|
||||||
|
- image: penpotapp/devenv:latest
|
||||||
|
|
||||||
|
# Specify service dependencies here if necessary
|
||||||
|
# CircleCI maintains a library of pre-built images
|
||||||
|
# documented at https://circleci.com/docs/2.0/circleci-images/
|
||||||
|
# - image: circleci/postgres:9.4
|
||||||
|
- image: circleci/postgres:13.1-ram
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: penpot_test
|
||||||
|
POSTGRES_PASSWORD: penpot_test
|
||||||
|
POSTGRES_DB: penpot
|
||||||
|
|
||||||
|
- image: circleci/redis:6.0.8
|
||||||
|
|
||||||
|
working_directory: ~/repo
|
||||||
|
|
||||||
|
environment:
|
||||||
|
# Customize the JVM maximum heap limit
|
||||||
|
JVM_OPTS: -Xmx512m
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
|
||||||
|
# Download and cache dependencies
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- v1-dependencies-{{ checksum "backend/deps.edn" }}
|
||||||
|
# fallback to using the latest cache if no exact match is found
|
||||||
|
- v1-dependencies-
|
||||||
|
|
||||||
|
# run lint
|
||||||
|
- run:
|
||||||
|
working_directory: "./backend"
|
||||||
|
name: lint
|
||||||
|
command: "clj-kondo --lint src/"
|
||||||
|
|
||||||
|
# run test
|
||||||
|
- run:
|
||||||
|
working_directory: "./backend"
|
||||||
|
name: test
|
||||||
|
command: "clojure -M:dev:tests"
|
||||||
|
environment:
|
||||||
|
PENPOT_DATABASE_URI: "postgresql://localhost/penpot"
|
||||||
|
PENPOT_DATABASE_USERNAME: penpot_test
|
||||||
|
PENPOT_DATABASE_PASSWORD: penpot_test
|
||||||
|
PENPOT_REDIS_URI: "redis://localhost/1"
|
||||||
|
|
||||||
|
- save_cache:
|
||||||
|
paths:
|
||||||
|
- ~/.m2
|
||||||
|
key: v1-dependencies-{{ checksum "backend/deps.edn" }}
|
||||||
|
|
2
backend/scripts/tests.sh
Executable file
2
backend/scripts/tests.sh
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
exec clojure -M:dev:tests "$@"
|
|
@ -221,11 +221,11 @@
|
||||||
|
|
||||||
(defn- read-test-config
|
(defn- read-test-config
|
||||||
[env]
|
[env]
|
||||||
(assoc (read-config env)
|
(merge {:redis-uri "redis://redis/1"
|
||||||
:redis-uri "redis://redis/1"
|
:database-uri "postgresql://postgres/penpot_test"
|
||||||
:database-uri "postgresql://postgres/penpot_test"
|
:storage-fs-directory "/tmp/app/storage"
|
||||||
:storage-fs-directory "/tmp/app/storage"
|
:migrations-verbose false}
|
||||||
:migrations-verbose false))
|
(read-config env)))
|
||||||
|
|
||||||
(def version (v/parse "%version%"))
|
(def version (v/parse "%version%"))
|
||||||
(def config (read-config env))
|
(def config (read-config env))
|
||||||
|
|
|
@ -77,8 +77,10 @@
|
||||||
|
|
||||||
(defn clean-storage
|
(defn clean-storage
|
||||||
[next]
|
[next]
|
||||||
(fs/delete (fs/path "/tmp/penpot"))
|
(let [path (fs/path "/tmp/penpot")]
|
||||||
(next))
|
(when (fs/exists? path)
|
||||||
|
(fs/delete (fs/path "/tmp/penpot")))
|
||||||
|
(next)))
|
||||||
|
|
||||||
(defn serial
|
(defn serial
|
||||||
[& funcs]
|
[& funcs]
|
||||||
|
|
Loading…
Add table
Reference in a new issue