Compare commits
No commits in common. "8c3534f8d4db20db3d01d8b8e3c502a0953837eb" and "41bcf480e2b263ae20259fb174f6a24520c85887" have entirely different histories.
8c3534f8d4
...
41bcf480e2
|
@ -1,26 +0,0 @@
|
||||||
name: release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Create release
|
|
||||||
id: create-release
|
|
||||||
uses: https://gitea.com/actions/release-action@main
|
|
||||||
with:
|
|
||||||
files: |-
|
|
||||||
src/**
|
|
||||||
template/**
|
|
||||||
LICENSE
|
|
||||||
typst.toml
|
|
||||||
README.md
|
|
||||||
example.pdf
|
|
||||||
api_key: '${{secrets.RELEASE_TOKEN}}'
|
|
49
run-ci.sh
49
run-ci.sh
|
@ -1,42 +1,33 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
function log() {
|
|
||||||
local timestamp=$(date +"%Y-%m-%d %H:%M:%S")
|
|
||||||
echo "$1 at $timestamp: $2"
|
|
||||||
}
|
|
||||||
|
|
||||||
function abort() {
|
function abort() {
|
||||||
log "ERROR" "test case $1 has failed"
|
echo "test case `$1` has failed" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function print-box() {
|
echo "Compiling template..."
|
||||||
printf "\\n"
|
typst compile template/main.typ --root . || abort "template"
|
||||||
echo ".----------------------------------------------------------------."
|
|
||||||
printf "| %-62s |\\n" "$1"
|
|
||||||
echo "'----------------------------------------------------------------'"
|
|
||||||
}
|
|
||||||
|
|
||||||
function enter-section() {
|
echo "Running tests..."
|
||||||
print-box "$1"
|
|
||||||
|
|
||||||
log "INFO" "running task in section $1: $2"
|
echo "Running test local-import..."
|
||||||
log "INFO" "section output following..."
|
typst compile tests/local-import/main.typ --root . || abort "local-import"
|
||||||
printf "\\n"
|
|
||||||
|
|
||||||
eval "$2"
|
echo "Running test invalid-config..."
|
||||||
if [ $? -neq $3 ]; then
|
|
||||||
abort "command: $2 failed in section: $1"
|
echo "Expected to fail..."
|
||||||
|
typst compile tests/invalid-config/test-case-1.typ --root .
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
abort "invalid-config case 1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "\\n"
|
typst compile tests/invalid-config/test-case-2.typ --root . || abort "invalid-config case 2"
|
||||||
log "INFO" "section $1 completed successfully"
|
|
||||||
}
|
|
||||||
|
|
||||||
enter-section "Compiling template..." "typst compile template/main.typ --root . example.pdf" 0
|
echo "Expected to fail..."
|
||||||
enter-section "TEST: local template import" "typst compile tests/local-import/main.typ --root ." 0
|
typst compile tests/invalid-config/test-case-3.typ --root .
|
||||||
enter-section "TEST: invalid config case 1" "typst compile tests/invalid-config/test-case-1.typ --root ." 1
|
if [ $? -eq 0 ]; then
|
||||||
enter-section "TEST: invalid config case 2" "compile tests/invalid-config/test-case-2.typ" 0
|
abort "invalid-config case 3b"
|
||||||
enter-section "TEST: invalid config case 3" "typst compile tests/invalid-config/test-case-3.typ --root ." 1
|
fi
|
||||||
|
|
||||||
log "INFO" "CI completed successfully"
|
|
||||||
|
echo "Tests completed successfully"
|
||||||
|
|
Loading…
Reference in New Issue