Include unit test. #111
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Typst document (CI) | |
on: | |
push: | |
paths: | |
- '**/*.typ' | |
- '**/*.yaml' | |
- '**/*.toml' | |
workflow_dispatch: | |
paths: | |
- '**/*.typ' | |
- '**/*.yaml' | |
- '**/*.toml' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: typst-community/setup-typst@v3 | |
with: | |
version: latest | |
- name: Delete samples and test | |
run: | | |
rm -rf ./examples/*.pdf | |
rm -rf ./test/*.pdf | |
- name: List Files examples | |
id: file-list-examples | |
shell: bash | |
run: | | |
listexamples=$(ls -1 ./examples/*.typ); | |
file_list_examples=$(echo "$listexamples" | sed ':a;N;$!ba;s/\n/ /g') | |
echo "File List Examples: $file_list_examples" | |
echo "file_list_examples=$file_list_examples" >> $GITHUB_OUTPUT | |
- name: Compile Typst examples to PDF | |
uses: mkpoli/compile-typst-action@main | |
with: | |
source_paths: ${{ steps.file-list.outputs.file_list_examples }} | |
root_path: '.' | |
- name: List Files test | |
id: file-list-test | |
shell: bash | |
run: | | |
listtest=$(ls -1 ./test/*.typ); | |
file_list_test=$(echo "$listtest" | sed ':a;N;$!ba;s/\n/ /g') | |
echo "File List Test: $file_list_test" | |
echo "file_list_test=$file_list_test" >> $GITHUB_OUTPUT | |
- name: Compile Typst test to PDF | |
uses: mkpoli/compile-typst-action@main | |
with: | |
source_paths: ${{ steps.file-list.outputs.file_list_test }} | |
root_path: '.' | |
- name: Delete Doc | |
run: | | |
rm -rf ./doc/*.pdf | |
- name: Compile documentation to PDF | |
uses: mkpoli/compile-typst-action@main | |
with: | |
source_paths: "doc/manual.typ" | |
root_path: '.' | |
- name: Upload examples PDF file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: examples-g-exam | |
path: ./examples/*.pdf | |
- name: Upload documentation PDF file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: document-g-exam | |
path: ./doc/*.pdf |