Skip to content

Commit

Permalink
Add CircleCI configuration example
Browse files Browse the repository at this point in the history
  • Loading branch information
helins committed Jun 10, 2021
1 parent 547c15d commit 793f82c
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ $ clj -X:new-lib-cljc :name your-group/project-name
```


## Extra

The `./extra` directory contains additional files, not part of the template, but which the user might be interested in.
Currently, it only holds an example of a CircleCI configuration file.


## License

Copyright © 2021 Adam Helinski and Contributors
Expand Down
2 changes: 1 addition & 1 deletion bb.edn
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
:task (clojure {:extra-env {"CLOJARS_USERNAME" (first *command-line-args*)
"CLOJARS_PASSWORD" (slurp (second *command-line-args*))}}
"-X:deploy")}



dev
Expand Down
110 changes: 110 additions & 0 deletions extra/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
version: 2.1



# Anchors for reusability
with_java_version: &with_java_version
parameters:
java_version:
description: "OpenJDK version to test"
type: string

cache_paths_clojure: &cache_paths_clojure
paths:
- ~/.m2
- .cpcache




commands:
install_bb:
description: "Install Babashka"
parameters:
version:
default: "0.4.4"
type: string
steps:
- restore_cache:
keys:
- babashka-<< parameters.version >>
- run:
name: Download Babashka
command: if ! [ -f "bb" ]; then \curl -L https://github.com/babashka/babashka/releases/download/v<< parameters.version >>/babashka-<< parameters.version >>-linux-amd64.tar.gz -o bb.tar.gz ; fi
- run:
name: Uncompress Babashka
command: if [ -f "bb.tar.gz" ]; then \tar -xzvf bb.tar.gz ; fi
- run:
name: Ensure Babashka is executable
command: chmod +x bb
- save_cache:
key: babashka-<< parameters.version >>
paths:
- bb




executors:
exec_java:
docker:
- image: circleci/clojure:openjdk-<< parameters.java_version >>-tools-deps-node
<<: *with_java_version



jobs:

TestNode:
docker:
- image: circleci/clojure:openjdk-11-tools-deps-node-browsers
steps:
- checkout
- install_bb
- restore_cache:
keys:
- cljs-v1-{{ checksum "deps.edn" }}
- cljs-v1
- run:
name: Test
command: ./bb test:node
- run:
name: Test advanced
command: ./bb test:node:optimize
- save_cache:
key: cljs-v1-{{ checksum "deps.edn" }}
<<: *cache_paths_clojure


TestJVM:
<<: *with_java_version
executor:
name: exec_java
java_version: << parameters.java_version >>
docker:
- image: circleci/clojure:openjdk-11-tools-deps-node-browsers
steps:
- checkout
- install_bb
- restore_cache:
keys:
- clojure-v1-{{ checksum "pom.xml" }}
- clojure-v1
- run:
name: Koacha
command: ./bb test:jvm
- save_cache:
key: clojure-v1-{{ checksum "pom.xml" }}
<<: *cache_paths_clojure



workflows:
version: 2
Test:
jobs:
- TestNode
- TestJVM:
matrix:
parameters:
java_version: ["8", "11", "15"]

0 comments on commit 793f82c

Please sign in to comment.