Skip to content

initial attempt at CI build #10

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
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
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: clojure-data-cookbook CI

on: [push]

jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
# To install LaTeX to build PDF book
tinytex: true
# uncomment below and fill to pin a version
# version: SPECIFIC-QUARTO-VERSION-HERE

- name: Prepare Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Install Clojure tools
uses: DeLaGuardo/[email protected]
with:
cli: latest # Clojure CLI based on tools.deps

# Optional step:
- name: Cache Clojure dependencies
uses: actions/cache@v3
with:
path: |
~/.m2/repository
~/.gitlibs
~/.deps.clj
# List all files containing dependencies:
key: cljdeps-${{ hashFiles('deps.edn') }}
restore-keys: cljdeps-

# - name: Execute tests
# run: clojure -M:dev:test

- name: Prepare dependencies
run: clojure -P -Sthreads 1

- name: Build Markdown
run: clojure -M:dev -m scicloj.claykind.main --verbose

- name: Build the book
run: cd book && quarto render

- name: Deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: cd book && quarto publish gh-pages
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ pom.xml.asc
.dir-locals.el

# ignore built website on main branch, only see on gh-pages
public/
public/
1 change: 1 addition & 0 deletions book/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.quarto/
/_book/
/qmd/
17 changes: 10 additions & 7 deletions book/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ project:

format:
html:
theme: cosmo
theme:
light: flatly
dark: darkly

book:
title: "Clojure Data Cookbook"
favicon: images/icon.svg
chapters:
- index.qmd
- chapter_1_intro/1_1_welcome.md
- chapter_1_intro/1_2_why_clojure.md
- chapter_1_intro/1_3_set_up.md
- chapter_2_input_output/2_1_loading_data/index.qmd
- chapter_2_input_output/2_2_messy_data/index.qmd
- chapter_2_input_output/2_3_exporting_data/index.qmd
- chapter_3_data_manipulation/3_data_manipulation/index.qmd
- chapter_4_data_visualisation/4_2_graphs/index.qmd
- chapter_4_data_visualisation/noj_examples/index.qmd
- qmd/2-1-loading-data.md
- qmd/2-2-messy-data.md
- qmd/2-3-exporting-data.md
- qmd/3-data-manipulation.md
- qmd/4-2-graphs.md
- qmd/noj-examples.md
4 changes: 2 additions & 2 deletions book/chapter_2_input_output/2_3_exporting_data.clj
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
;; To do that call

(comment
(clerk/build! {:paths "path/to/files..."
:index "book/index.clj"}))
(clerk-setup/build! {:paths "path/to/files..."
:index "book/index.clj"}))

;; More information in Clerk's docs: https://book.clerk.vision/#static-building

Expand Down
6 changes: 0 additions & 6 deletions book/chapter_4_data_visualisation/4_2_graphs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@

(ns chapter-4-data-visualisation.4-2-graphs
(:require [tablecloth.api :as tc]
[aerial.hanami.common :as hc]
[aerial.hanami.templates :as ht]
[scicloj.noj.v1.vis.hanami.templates :as vht]
[scicloj.noj.v1.vis :as vis]
[scicloj.noj.v1.stats :as stats]
[scicloj.noj.v1.datasets :as datasets]
[tech.v3.datatype :as dtype]
[tech.v3.datatype.functional :as fun]
[hiccup.core :as hiccup]
[clojure2d.color :as color]
[tablecloth.api :as tc]
[scicloj.kind-clerk.api :as kind-clerk]))

Expand Down
148 changes: 148 additions & 0 deletions book/chapter_4_data_visualisation/4_2_graphs.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion book/chapter_4_data_visualisation/noj_examples.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

(kind-clerk/setup!)


;; ## Raw html
(-> "<p>Hello, <i>Noj</i>.</p>"
vis/raw-html)
Expand Down
393 changes: 393 additions & 0 deletions book/chapter_4_data_visualisation/noj_examples.md

Large diffs are not rendered by default.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
(ns experiments.oct-30
(:require [scicloj.clay.v2.api :as clay]
[scicloj.kindly.v3.kind :as kind]
[scicloj.kindly.v4.kind :as kind]
[clojure.string :as str]
[tablecloth.api :as tc]))


(clay/start!)

(comment
(clay/start!)
(clay/show-doc! "experiments/oct_30.clj" {:toc? true}))

;; https://r4ds.had.co.nz/transform.html
Expand Down
1 change: 1 addition & 0 deletions book/images/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading