Compare commits

..

4 Commits

Author SHA1 Message Date
Sven Vogel dabe0a2ef5 fixed failing tests
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 1m41s Details
2024-08-27 20:54:33 +02:00
Sven Vogel 6c8f94e4b7 fixed test local import 2024-08-27 20:36:21 +02:00
Sven Vogel ae729230bb made generate-theme executable 2024-08-27 20:28:50 +02:00
Sven Vogel 9c3ae5c9e7 switched to unstable nix channel 2024-08-27 20:27:41 +02:00
8 changed files with 96 additions and 87 deletions

0
generate-theme.sh Normal file → Executable file
View File

View File

@ -26,8 +26,17 @@ function enter-section() {
eval "$2" eval "$2"
exit_status=$? exit_status=$?
if ! [ $exit_status -eq $3 ]; then
abort "command: $2 failed in section: $1" if [ "$3" == "should fail" ]; then
log "INFO" "expected to fail..."
if [ $exit_status -eq 0 ]; then
abort "command: $2 failed in section: $1 with: $exit_status"
fi
else
log "INFO" "expected to pass..."
if [ ! $exit_status -eq 0 ]; then
abort "command: $2 failed in section: $1 with: $exit_status"
fi
fi fi
printf "\\n" printf "\\n"
@ -36,10 +45,10 @@ function enter-section() {
enter-section "Typstyle checking" "./run-fmt.sh --check src/lib.typ" 0 enter-section "Typstyle checking" "./run-fmt.sh --check src/lib.typ" 0
enter-section "BUILD: ABB code theme" "./generate-theme.sh" 0 enter-section "BUILD: ABB code theme" "./generate-theme.sh" 0
enter-section "Compiling template..." "typst compile template/main.typ --root . example.pdf" 0 enter-section "Compiling template..." "typst compile template/main.typ --root . example.pdf"
enter-section "TEST: local template import" "typst compile tests/local-import/main.typ --root ." 0 enter-section "TEST: local template import" "typst compile tests/local-import/main.typ --root ."
enter-section "TEST: invalid config case 1" "typst compile tests/invalid-config/test-case-1.typ --root ." 1 enter-section "TEST: invalid config case 1" "typst compile tests/invalid-config/test-case-1.typ --root ." "should fail"
enter-section "TEST: invalid config case 2" "compile tests/invalid-config/test-case-2.typ" 0 enter-section "TEST: invalid config case 2" "typst compile tests/invalid-config/test-case-2.typ --root ."
enter-section "TEST: invalid config case 3" "typst compile tests/invalid-config/test-case-3.typ --root ." 1 enter-section "TEST: invalid config case 3" "typst compile tests/invalid-config/test-case-3.typ --root ." "should fail"
log "INFO" "CI completed successfully" log "INFO" "CI completed successfully"

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
function format() { function format() {
# format file # format file
@ -16,7 +16,7 @@ function format() {
echo "failed format validation: $1" echo "failed format validation: $1"
exit 1 exit 1
fi fi
local imports=$(rg "#import \"([a-z0-9/\-]+\.typ)\"" -Nor '$1' "$1") local imports=$(rg "#import \"([a-z0-9/\-]+\.typ)\"" -Nor '$1' "$1")
# format all included files # format all included files
@ -39,4 +39,4 @@ case $1 in
echo "unknown option: $1" echo "unknown option: $1"
exit 1 exit 1
;; ;;
esac esac

View File

@ -1,5 +1,5 @@
let let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.05"; nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-unstable";
pkgs = import nixpkgs { config = {}; overlays = []; }; pkgs = import nixpkgs { config = {}; overlays = []; };
in in

View File

@ -1,8 +1,7 @@
#import "../../src/lib.typ": dhbw-template #import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with( #show: dhbw-template.with((
config: (
lang: none, lang: none,
region: "en", region: "en",
author: ( author: (

View File

@ -1,30 +1,32 @@
#import "../../src/lib.typ": dhbw-template #import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with( #show: dhbw-template.with((
config: ( lang: "en",
lang: "en", this-key-is-not-in-config: "Ha Ha",
this-key-is-not-in-config: "Ha Ha", region: "en",
region: "en", author: (
author: ( name: "Sven Vogel",
name: "Sven Vogel", semester: 4,
semester: 4, program: "Informationtechnology",
program: "Informationtechnology", course: "TINF19IT1",
course: "TINF19IT1", faculty: "Technik",
faculty: "Technik", university: "DHBW Mannheim",
university: "DHBW Mannheim", company: "ABB AG",
company: "ABB AG", supervisor: "Benny Goodman",
supervisor: "Benny Goodman", matriculation-number: 123456789,
matriculation-number: 123456789), ),
thesis: ( thesis: (
title: "Unofficial ABB/DHBW Typst template", title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises", subtitle: "for reports and thesises",
submission-date: "23rd march 2020", submission-date: "23rd march 2020",
timeframe: "1st january 2020 - 20th march 2020", timeframe: "1st january 2020 - 20th march 2020",
kind: "T2000", kind: "T2000",
summary: none, summary: none,
abstract: none, abstract: none,
keywords: ( "IT", "other stuff" ), keywords: ("IT", "other stuff"),
bibliography: none, bibliography: none,
glossary: none, glossary: none,
appendices: none))) appendices: none,
),
))

View File

@ -1,24 +1,26 @@
#import "../../src/lib.typ": dhbw-template #import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with( #show: dhbw-template.with((
config: ( lang: "en",
lang: "en", region: "en",
region: "en", author: (
author: ( university: "DHBW Mannheim",
university: "DHBW Mannheim", company: "ABB AG",
company: "ABB AG", supervisor: none,
supervisor: none, matriculation-number: 123456789,
matriculation-number: 123456789), ),
thesis: ( thesis: (
title: "Unofficial ABB/DHBW Typst template", title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises", subtitle: "for reports and thesises",
submission-date: "23rd march 2020", submission-date: "23rd march 2020",
timeframe: "1st january 2020 - 20th march 2020", timeframe: "1st january 2020 - 20th march 2020",
kind: "T2000", kind: "T2000",
summary: none, summary: none,
abstract: none, abstract: none,
keywords: ( "IT", "other stuff" ), keywords: ("IT", "other stuff"),
bibliography: none, bibliography: none,
glossary: none, glossary: none,
appendices: none))) appendices: none,
),
))

View File

@ -1,29 +1,26 @@
#import "../../src/lib.typ": dhbw-template #import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with( #show: dhbw-template.with((
config: ( lang: "en",
lang: "en", region: "en",
region: "en", author: (
author: ( university: "DHBW Mannheim",
name: "Sven Vogel", company: "ABB AG",
semester: 4, supervisor: "Vivaldi",
program: "Informationtechnology", matriculation-number: 123456789,
course: "TINF19IT1", ),
faculty: "Technik", thesis: (
university: "DHBW Mannheim", title: "Unofficial ABB/DHBW Typst template",
company: "ABB AG", subtitle: "for reports and thesises",
supervisor: "Benny Goodman", submission-date: "23rd march 2020",
matriculation-number: 123456789), timeframe: "1st january 2020 - 20th march 2020",
thesis: ( kind: "T2000",
title: "Unofficial ABB/DHBW Typst template", summary: none,
subtitle: "for reports and thesises", abstract: none,
submission-date: "23rd march 2020", keywords: ("IT", "other stuff"),
timeframe: "1st january 2020 - 20th march 2020", bibliography: none,
kind: "T2000", glossary: none,
summary: none, appendices: none,
abstract: none, ),
keywords: ( "IT", "other stuff" ), ))
bibliography: none,
glossary: none,
appendices: none)))