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

WIP: update choices #35

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
10 changes: 8 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v2
- name: install-deps
run: sudo apt install -y leiningen make
- name: install-system-deps
run: sudo apt install -y curl make rlwrap clojure
- name: download-newer-clojure
run: curl -L -O https://github.com/clojure/brew-install/releases/latest/download/posix-install.sh
- name: chmod-posix-install
run: chmod +x posix-install.sh
- name: install-newer-clojure
run: sudo ./posix-install.sh
- name: make
run: make
- name: upload
Expand Down
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: CC0-1.0

# ensure `lein` is installled
# sudo apt install leiningen
# ensure clj is installed
# https://clojure.org/guides/install_clojure#posix

# https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html
# $@ : target label
Expand All @@ -10,18 +10,21 @@

SHELL := bash
BROWSER ?= firefox
CLJ ?= clj

.PHONY: default
default: all

choices/project.clj:
choices/LICENSE:
git submodule update --init --recursive
ls -l $@
@echo SUCCESS $@

choices/resources/public/js/choices.js: choices/project.clj config.yml
choices/config.yml: choices/LICENSE config.yml
cp -v config.yml choices/config.yml
cd choices && lein fig:min

choices/resources/public/js/choices.js: choices/LICENSE choices/config.yml
cd choices && $(CLJ) -M:js
ls -l $@
@echo SUCCESS $@

Expand All @@ -40,8 +43,8 @@ view: choices/resources/public/index.html
@echo SUCCESS $@

.PHONY: choices-test
choices-test: choices/project.clj
cd choices && lein test
choices-test: choices/LICENSE choices/config.yml
cd choices && $(CLJ) -M:test
@echo SUCCESS $@

.PHONY: check
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ We welcome contributions, please create [issues](https://github.com/publiccodene
## Building and testing

This tool is built upon [Choices](https://git.sr.ht/~bzg/choices) by [Bastien Guerry](https://sr.ht/~bzg/).
Choices is a ClojureScript project, and can be built with `lein`.
Choices is a ClojureScript project, and uses `clj`.
The build process uses `make`.
On debian-like systems, `lein` and `make` can be installed with `apt`:

```
sudo apt install leiningen make
sudo apt install make
curl -L -O https://github.com/clojure/brew-install/releases/latest/download/posix-install.sh
chmod +x posix-install.sh
sudo ./posix-install.sh
```

To make changes, edit the `config.yml` file.
Expand Down
2 changes: 1 addition & 1 deletion choices
Submodule choices updated from b892f5 to e9db57
4 changes: 2 additions & 2 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ display-score-details: true
display-score-top-result: true

# In a branch of the tree, should the target node be set depending on
# the updated value of conditional-score-outputs?
# the updated value of conditional-score-output?
conditional-navigation: false

# Some text message to always display after the score results
Expand Down Expand Up @@ -74,7 +74,7 @@ score-variables:
# (2) message (mandatory): message to display when one of the condition is met
# (3) anything else is a "condition", which lists variables and their minimal
# values for the condition to be met.
conditional-score-outputs:
conditional-score-output:
cas-1: # free-form
notification: "is-success"
priority: 1
Expand Down