Skip to content

Commit e0f288c

Browse files
committed
add makefile and update gitlab-ci template
* `make test` pull and test codes in `juliatest` block * `make compile` compiles the complete book into `book.pdf` * `make clean` cleans all generated files except `book.pdf`
1 parent 72c9516 commit e0f288c

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ before_script:
2222

2323
.test_template: &test_definition
2424
script:
25-
- julia pull_julia_code.jl
26-
- julia runtests.jl
25+
- make test
2726

2827
Julia 1.0:
2928
image: johnnychen94/juliabook:1.0
@@ -40,17 +39,11 @@ Julia 1.2:
4039
stage: test
4140
<<: *test_definition
4241

43-
# compile the book only when all tests pass
4442
Deploy:
4543
image: johnnychen94/juliabook:stable
4644
stage: deploy
4745
script:
48-
# compile the book
49-
- julia pull_julia_code.jl
50-
- lualatex book
51-
- pythontex3 book
52-
- biber book
53-
- lualatex book
46+
- make compile
5447
artifacts:
5548
paths:
5649
- "book.pdf"

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ The template allows for the direct compilation of a print-ready PDF, including s
66

77
We do all of our development in Ubuntu.
88

9-
## Installation
109

1110
Install [Julia](https://julialang.org/downloads/platform.html).
1211

@@ -55,13 +54,14 @@ Install it over the version of pythontex that was just installed.
5554

5655
(Note that on arch-based systems, one should use tllocalmgr instead.)
5756

57+
## Test
58+
59+
Running `make test` pulls all the code and then runs all tests in `juliatest` blocks. See `runtests.jl` for details.
60+
5861
## Compilation
5962

60-
The textbook can be compiled as follows:
61-
```
62-
julia pull_julia_code.jl
63-
lualatex book
64-
pythontex book
65-
biber book
66-
lualatex book
67-
```
63+
* `make compile` compiles the whole book
64+
* `make clean` removes all generated files except `book.pdf`
65+
66+
If you host your project under Gitlab, `.gitlab-ci.yml` is a CI/CD template to start with.
67+

makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
test:
2+
julia --color=yes pull_julia_code.jl
3+
julia --color=yes runtests.jl
4+
compile:
5+
julia --color=yes pull_julia_code.jl
6+
lualatex book
7+
pythontex book
8+
biber book
9+
lualatex book
10+
clean:
11+
find . -type f -name "*.aux" -exec rm -f {} \;
12+
rm -f book.bbl book.blg book.bcf book.idx book.log book.out book.pytxcode book.run.xml book.toc
13+
rm -f all_algorithm_blocks.jl all_juliaconsole_blocks.jl all_test_blocks.jl
14+
rm -rf pythontex-files-book

0 commit comments

Comments
 (0)