π Convert examples .book.md
-> .bookc
#857
This file contains hidden or 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: β Checks | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test-books: | |
name: π§ͺβ¨ Test Books | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install dependencies | |
run: npm ci | |
- name: Test Books | |
# TODO: [π―] In future maybe remove `--no-prepare` | |
# Thare is also an issue with full `test` that following error occures: | |
# > ./src/cli/test/ptbk.ts test "./**/*.book" | |
# > Pipeline is not valid ./book/examples/27-document-knowledge.book | |
# > EnvironmentMismatchError: Can not import file knowledge in non-file pipeline | |
#> env: | |
#> OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
#> ANTHROPIC_CLAUDE_API_KEY: ${{ secrets.ANTHROPIC_CLAUDE_API_KEY }} | |
#> GOOGLE_GENERATIVE_AI_API_KEY: ${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }} | |
run: npx ts-node ./src/cli/test/ptbk.ts test --no-prepare "./**/*.book" --ignore "./book/**/*,./examples/pipelines/errors/**/*" --verbose | |
test-types: | |
name: π§ͺ Test types | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install dependencies | |
run: npm ci | |
- name: Test types | |
run: tsc | |
lint: | |
name: π§ͺ Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint | |
run: npm run lint | |
# TODO: Unit tests are failing on Github Actions with the following error, fix it: | |
# "Jest worker encountered 4 child process exceptions" | |
#> test: | |
#> name: π§ͺ Unit tests | |
#> runs-on: ubuntu-latest | |
#> steps: | |
#> - uses: actions/checkout@v4 | |
#> - uses: actions/setup-node@v4 | |
#> with: | |
#> node-version: 22 | |
#> | |
#> - name: Install LibreOffice | |
#> run: sudo apt-get update && sudo apt-get install -y libreoffice | |
#> | |
#> - name: Install Pandoc | |
#> run: | | |
#> wget https://github.com/jgm/pandoc/releases/download/3.6.1/pandoc-3.6.1-1-amd64.deb | |
#> sudo dpkg -i pandoc-3.6.1-1-amd64.deb | |
#> | |
#> - name: Install dependencies | |
#> run: npm ci | |
#> | |
#> - name: Test | |
#> env: | |
#> OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
#> ANTHROPIC_CLAUDE_API_KEY: ${{ secrets.ANTHROPIC_CLAUDE_API_KEY }} | |
#> GOOGLE_GENERATIVE_AI_API_KEY: ${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }} | |
#> run: NODE_OPTIONS="--max-old-space-size=32000" npx jest | |
name-discrepancies: | |
name: π Find name discrepancies | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install dependencies | |
run: npm ci --only=production | |
- name: Find name discrepancies | |
run: npx ts-node ./scripts/find-name-discrepancies/find-name-discrepancies.ts |