Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .github/workflows/update-tesseract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
fetch-depth: 1
- name: update-dockerfile
run: |
sed -i 's/\(TESSERACT_VERSION=\)[0-9\.]*$/\1${{ steps.tesseract.outputs.result }}/g' Dockerfile.al1
sed -i 's/\(TESSERACT_VERSION=\)[0-9\.]*$/\1${{ steps.tesseract.outputs.result }}/g' Dockerfile.al2
sed -i 's/\(LEPTONICA_VERSION=\)[0-9\.]*$/\1${{ steps.leptonica.outputs.result }}/g' Dockerfile.al1
sed -i 's/\(TESSERACT_VERSION=\)[0-9\.]*$/\1${{ steps.tesseract.outputs.result }}/g' Dockerfile.al2023
sed -i 's/\(LEPTONICA_VERSION=\)[0-9\.]*$/\1${{ steps.leptonica.outputs.result }}/g' Dockerfile.al2
sed -i 's/\(LEPTONICA_VERSION=\)[0-9\.]*$/\1${{ steps.leptonica.outputs.result }}/g' Dockerfile.al2023
- name: update-README
run: |
sed -i 's/\(https:\/\/img\.shields\.io\/badge\/Tesseract-\)\(v\?\([0-9]\+\.\?\)\{3\}\)\(-green\)/\1${{ steps.tesseract.outputs.result }}\4/g' README.md
Expand Down
2 changes: 2 additions & 0 deletions .gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 23 additions & 12 deletions .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 70 additions & 12 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@ const project = new awscdk.AwsCdkTypeScriptApp({
srcdir: 'continous-integration',
// Use built-in dep upgrades
dependabot: false,
gitignore: ['layer', '.serverless', '.mypy_cache', '*.zip', '**/*test-output.txt', 'cdk.out/'],
gitignore: [
'layer',
'.serverless',
'.mypy_cache',
'*.zip',
'**/*test-output.txt',
'py312-test-output.txt',
'node20-test-output.txt',
'cdk.out/',
],
autoApproveUpgrades: false,
depsUpgrade: true,
depsUpgradeOptions: {
Expand Down Expand Up @@ -115,33 +124,68 @@ class BinaryPatchComponent extends Component {

new BinaryPatchComponent(project);

project.addTask(`test:integration:python`, {
// AL2 integration tests temporarily disabled (AL2 deprecated, GCC 7.3.1 incompatible with Tesseract 5.5.2)
// project.addTask(`test:integration:python`, {
// steps: [
// {
// spawn: `synth:silent`,
// },
// {
// exec: `sam local invoke -t cdk.out/tesseract-lambda-ci.template.json python --no-event > py-test-output.txt && cat py-test-output.txt | grep -Eiv \"(fail|error|exception)\"`,
// },
// ],
// });
// project.addTask(`test:integration:node`, {
// steps: [
// {
// spawn: `synth:silent`,
// },
// {
// exec: `sam local invoke -t cdk.out/tesseract-lambda-ci.template.json node --no-event > node-test-output.txt && cat node-test-output.txt | grep -Eiv \"(fail|error|exception)\"`,
// },
// ],
// });
project.addTask(`test:integration:python312`, {
steps: [
{
spawn: `synth:silent`,
},
{
exec: `sam local invoke -t cdk.out/tesseract-lambda-ci.template.json python --no-event > py-test-output.txt && cat py-test-output.txt | grep -Eiv \"(fail|error|exception)\"`,
exec: `sam local invoke -t cdk.out/tesseract-lambda-ci.template.json python312 --no-event > py312-test-output.txt && cat py312-test-output.txt | grep -Eiv \"(fail|error|exception)\"`,
},
],
});
project.addTask(`test:integration:node`, {
project.addTask(`test:integration:node20`, {
steps: [
{
spawn: `synth:silent`,
},
{
exec: `sam local invoke -t cdk.out/tesseract-lambda-ci.template.json node --no-event > node-test-output.txt && cat node-test-output.txt | grep -Eiv \"(fail|error|exception)\"`,
exec: `sam local invoke -t cdk.out/tesseract-lambda-ci.template.json node20 --no-event > node20-test-output.txt && cat node20-test-output.txt | grep -Eiv \"(fail|error|exception)\"`,
},
],
});
const testIntegration = project.addTask(`test:integration`, {
project.addTask(`test:integration:al2023`, {
steps: [
{
spawn: `test:integration:python`,
spawn: `test:integration:python312`,
},
{
spawn: `test:integration:node`,
spawn: `test:integration:node20`,
},
],
});
const testIntegration = project.addTask(`test:integration`, {
steps: [
// AL2 tests disabled (see note about AL2 build issue in continous-integration/main.ts)
// {
// spawn: `test:integration:python`,
// },
// {
// spawn: `test:integration:node`,
// },
{
spawn: `test:integration:al2023`,
},
],
});
Expand All @@ -150,18 +194,32 @@ const bundle = project.addTask(`bundle:binary`, {
{
spawn: `synth:silent`,
},
// AL2 bundling disabled (see note about AL2 build issue in continous-integration/main.ts)
// AL2 users can build locally with older Tesseract if needed
// {
// exec: `rm -rf ./ready-to-use/amazonlinux-2/*`,
// },
// {
// exec: `cp -r cdk.out/$(cat cdk.out/tesseract-lambda-ci.template.json | jq -r '.Resources.al2layer.Metadata.\"aws:asset:path\"')/. ./ready-to-use/amazonlinux-2`,
// },
// AL2023 bundling
{
exec: `mkdir -p ./ready-to-use/amazonlinux-2023`,
},
{
exec: `rm -rf ./ready-to-use/amazonlinux-2/*`,
exec: `rm -rf ./ready-to-use/amazonlinux-2023/*`,
},
{
exec: `cp -r cdk.out/$(cat cdk.out/tesseract-lambda-ci.template.json | jq -r '.Resources.al2layer.Metadata.\"aws:asset:path\"')/. ./ready-to-use/amazonlinux-2`,
exec: `cp -r cdk.out/$(cat cdk.out/tesseract-lambda-ci.template.json | jq -r '.Resources.al2023layer.Metadata.\"aws:asset:path\"')/. ./ready-to-use/amazonlinux-2023`,
},
],
});
project.packageTask.prependSpawn(testIntegration);
project.packageTask.prependSpawn(bundle);
project.packageTask.prependExec(`mkdir -p ./dist`);
project.packageTask.exec(`zip -r ../../dist/tesseract-al2-x86.zip .`, { cwd: './ready-to-use/amazonlinux-2' });
// AL2 packaging disabled (see note about AL2 build issue in continous-integration/main.ts)
// project.packageTask.exec(`zip -r ../../dist/tesseract-al2-x86.zip .`, { cwd: './ready-to-use/amazonlinux-2' });
project.packageTask.exec(`zip -r ../../dist/tesseract-al2023-x86.zip .`, { cwd: './ready-to-use/amazonlinux-2023' });
project.addTask('upgrade:ci:py', {
steps: [
{
Expand Down Expand Up @@ -209,7 +267,7 @@ project.release?.addJobs({
GITHUB_REPOSITORY: '${{ github.repository }}',
GITHUB_REF: '${{ github.ref }}',
},
run: 'errout=$(mktemp); gh release upload $(cat dist/releasetag.txt) --clobber -R $GITHUB_REPOSITORY dist/tesseract-al2-x86.zip 2> $errout && true; exitcode=$?; if [ $exitcode -ne 0 ] && ! grep -q "Release.tag_name already exists" $errout; then cat $errout; exit $exitcode; fi',
run: 'errout=$(mktemp); gh release upload $(cat dist/releasetag.txt) --clobber -R $GITHUB_REPOSITORY dist/tesseract-al2023-x86.zip 2> $errout && true; exitcode=$?; if [ $exitcode -ne 0 ] && ! grep -q "Release.tag_name already exists" $errout; then cat $errout; exit $exitcode; fi',
},
],
},
Expand Down
Loading