Skip to content

Commit 7e3ad60

Browse files
authored
Fixes CircleCI tests run (#69)
Fixes CircleCI tests run by: - replacing Docker Image with VM which has a running OpenSSH server required to run tests - skip creating id_rsa if it exists to prevent using `yes` which causes CircleCI to fail allowing to use existent key. Additionally, upgraded CircleCI config to latest 2.1 version and added friendly names to the CI steps.
1 parent 61757bd commit 7e3ad60

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

.circleci/config.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
# Clojure CircleCI 2.0 configuration file
2-
#
3-
# Check https://circleci.com/docs/2.0/language-clojure/ for more details
4-
#
5-
version: 2
1+
version: 2.1
62
jobs:
73
build:
8-
docker:
9-
# specify the version you desire here
10-
- image: circleci/clojure:lein-2.7.1
4+
machine:
5+
image: ubuntu-2004:2023.07.1
116

12-
# Specify service dependencies here if necessary
13-
# CircleCI maintains a library of pre-built images
14-
# documented at https://circleci.com/docs/2.0/circleci-images/
15-
# - image: circleci/postgres:9.4
7+
resource_class: medium
168

179
working_directory: ~/repo
1810

@@ -31,28 +23,38 @@ jobs:
3123
# fallback to using the latest cache if no exact match is found
3224
- v1-dependencies-
3325

34-
- run: lein deps
26+
- run:
27+
name: Setup environment
28+
command: sudo apt-get update && sudo apt-get install -y openjdk-8-jdk leiningen
29+
30+
- run:
31+
name: Fetch project dependencies
32+
command: lein deps
3533

3634
- save_cache:
3735
paths:
3836
- ~/.m2
3937
key: v1-dependencies-{{ checksum "project.clj" }}
38+
4039
- run:
40+
name: Setup tests
4141
command: |
42-
yes y | ssh-keygen -N "" -f ~/.ssh/id_rsa >/dev/null
42+
[[ -f ~/.ssh/id_rsa ]] || ssh-keygen -N "" -f ~/.ssh/id_rsa
4343
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
4444
ssh-keygen -f ~/.ssh/clj_ssh -t rsa -C "key for test clj-ssh" -N ""
4545
ssh-keygen -f ~/.ssh/clj_ssh_pp -t rsa -C "key for test clj-ssh" -N "clj-ssh"
4646
echo "from=\"127.0.0.1,localhost,0.0.0.0\" $(cat ~/.ssh/clj_ssh.pub)" >> ~/.ssh/authorized_keys
4747
echo "from=\"127.0.0.1,localhost,0.0.0.0\" $(cat ~/.ssh/clj_ssh_pp.pub)" >> ~/.ssh/authorized_keys
4848
eval $(ssh-agent)
49-
cat << EOF > pp
49+
cat \<< EOF > pp
5050
#!/bin/sh
5151
echo "clj-ssh"
5252
EOF
5353
chmod +x pp
5454
export SSH_ASKPASS=./pp
5555
export DISPLAY=1
5656
setsid ssh-add ~/.ssh/clj_ssh_pp < /dev/null >/dev/null 2>&1
57-
# run tests!
58-
- run: lein test
57+
58+
- run:
59+
name: Run tests
60+
command: lein test

0 commit comments

Comments
 (0)