Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes CircleCI tests run #69

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
# Clojure CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-clojure/ for more details
#
version: 2
version: 2.1
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/clojure:lein-2.7.1
machine:
image: ubuntu-2004:2023.07.1

# 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
resource_class: medium

working_directory: ~/repo

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

- run: lein deps
- run:
name: Setup environment
command: sudo apt-get update && sudo apt-get install -y openjdk-8-jdk leiningen

- run:
name: Fetch project dependencies
command: lein deps

- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "project.clj" }}

- run:
name: Setup tests
command: |
yes y | ssh-keygen -N "" -f ~/.ssh/id_rsa >/dev/null
[[ -f ~/.ssh/id_rsa ]] || ssh-keygen -N "" -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh-keygen -f ~/.ssh/clj_ssh -t rsa -C "key for test clj-ssh" -N ""
ssh-keygen -f ~/.ssh/clj_ssh_pp -t rsa -C "key for test clj-ssh" -N "clj-ssh"
echo "from=\"127.0.0.1,localhost,0.0.0.0\" $(cat ~/.ssh/clj_ssh.pub)" >> ~/.ssh/authorized_keys
echo "from=\"127.0.0.1,localhost,0.0.0.0\" $(cat ~/.ssh/clj_ssh_pp.pub)" >> ~/.ssh/authorized_keys
eval $(ssh-agent)
cat << EOF > pp
cat \<< EOF > pp
#!/bin/sh
echo "clj-ssh"
EOF
chmod +x pp
export SSH_ASKPASS=./pp
export DISPLAY=1
setsid ssh-add ~/.ssh/clj_ssh_pp < /dev/null >/dev/null 2>&1
# run tests!
- run: lein test

- run:
name: Run tests
command: lein test