Skip to content

Commit

Permalink
Merge pull request #21 from phip1611/nix
Browse files Browse the repository at this point in the history
nix: update toolchain
  • Loading branch information
schirmeier authored Nov 13, 2024
2 parents 0a68176 + 593ee60 commit af53646
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 53 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ trim_trailing_whitespace = true
[Makefile]
indent_style = tab

[*.yml]
indent_size = 2

[*.tex]
max_line_length = 100
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
99 changes: 56 additions & 43 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,61 @@
name: "Build"
on:
pull_request:
push:
pull_request:
push:
merge_group:

jobs:
# uses nix
nix_build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v17
- run: nix-build
# -s: test if this is a file and if it has a size.
- run: test -s result/diplom.pdf
# Builds the Nix derivation.
nix_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v24
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix-build
# -s: test if this is a file and if it has a size.
- run: test -s result/diplom.pdf

# Tests the regular build but with a toolchain from the Nix shell.
nix_shell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v24
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix-shell --run "make"
- run: nix-shell --run "make stats"

# uses latexmk
regular_build:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
with:
# options listed here:
# https://github.com/xu-cheng/latex-action
root_file: diplom.tex
latexmk_use_lualatex: true
# required when using the "minted" package for beautiful styled code
# latexmk_shell_escape: true
# Builds with a regular toolchain via latexmk.
regular_build:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
with:
# options listed here:
# https://github.com/xu-cheng/latex-action
root_file: diplom.tex
latexmk_use_lualatex: true
# required when using the "minted" package for beautiful styled code
# latexmk_shell_escape: true

# checkbiw and check-french-spacing must execute without error
check_scripts:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
# additionally: check out submodules
with:
submodules: recursive
- name: install make
run: sudo apt update && sudo apt install make
- name: make check-french-spacing
run: make check-french-spacing
- name: install diction
run: sudo apt update && sudo apt install diction
- name: make checkbiw
run: make checkbiw
# checkbiw and check-french-spacing must execute without error
check_scripts:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v4
# additionally: check out submodules
with:
submodules: recursive
- name: install make
run: sudo apt update && sudo apt install make
- name: make check-french-spacing
run: make check-french-spacing
- name: install diction
run: sudo apt update && sudo apt install diction
- name: make checkbiw
run: make checkbiw
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ CMD_COUNT_PAGES = pdfinfo $(DOC_PDF) | awk '/^Pages:/ {print $$2}'
CMD_COUNT_WORDS = pdftotext $(DOC_PDF) $(DOC_PDF:.pdf=.pdf.txt) && cat $(DOC_PDF:.pdf=.pdf.txt) | grep -E '^\.+\ *$$' -v | wc -w

stats: pdf
$(QUIET)echo "\e[1mThesis Stats:\e[0m"
$(QUIET)echo " \e[1mdetexed sources and removed empty lines:\e[0m"
$(QUIET)echo -e "\e[1mThesis Stats:\e[0m"
$(QUIET)echo -e " \e[1mdetexed sources and removed empty lines:\e[0m"
$(QUIET)echo " lines: $(shell detex $(DOC_TEX_ALL_SORTED) | sed '/^$$/d' | wc -l)"
$(QUIET)echo " words: $(shell detex $(DOC_TEX_ALL_SORTED) | sed '/^$$/d' | wc -w)"
$(QUIET)echo " characters: $(shell detex $(DOC_TEX_ALL_SORTED) | sed '/^$$/d' | wc --chars)"
Expand All @@ -90,6 +90,6 @@ stats: pdf
$(QUIET)echo " version might contain additional words, such as 'in Figure 3.5 on the"
$(QUIET)echo " next page' or the bibliography."
$(QUIET)echo
$(QUIET)echo " \e[1mCompiled PDF:\e[0m"
$(QUIET)echo -e " \e[1mCompiled PDF:\e[0m"
$(QUIET)echo " pages: $(shell $(CMD_COUNT_PAGES)) (in total)"
$(QUIET)echo " words: $(shell $(CMD_COUNT_WORDS)) (roughly)"
14 changes: 7 additions & 7 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
"homepage": "",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"sha256": "07vg2i9va38zbld9abs9lzqblz193vc5wvqd6h7amkmwf66ljcgh",
"rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5",
"sha256": "1rlja3ba9s1n0icy3aarwhx9hk1jyfgngzizbn1afwwdlpvdlqw0",
"type": "tarball",
"url": "https://github.com/hercules-ci/gitignore.nix/archive/a20de23b925fd8264fd7fad6454652e142fd7f73.tar.gz",
"url": "https://github.com/hercules-ci/gitignore.nix/archive/43e1aa1308018f37118e34d3a9cb4f5e75dc11d5.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
"branch": "release-22.11",
"branch": "release-23.11",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "62ffdb32823e8d8caca00d0d75ac8e02212de76b",
"sha256": "0nfz26f2lc75av8ijvavq3ajq6cqwmlkn62fcy76222v9hyhqdcy",
"rev": "6723fa4e4f1a30d42a633bef5eb01caeb281adc3",
"sha256": "16wshya4xpy5ipsjlcyy13qi01slma6825y5ihzq0c90g3y8l6h0",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/62ffdb32823e8d8caca00d0d75ac8e02212de76b.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/6723fa4e4f1a30d42a633bef5eb01caeb281adc3.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
1 change: 1 addition & 0 deletions nix/tex-toolchain.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ texlive.combine {
biber
biblatex
csquotes
detex # Only for Makefile convenience scripts; not for the actual build
hyphenat
lastpage
latexmk
Expand Down

0 comments on commit af53646

Please sign in to comment.