Test CI #18
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: Test CI | |
on: | |
# Triggers the workflow on push and pull request events but only for pull_requests on the main branch | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
# Allows you to run this workflow manually | |
workflow_dispatch: | |
jobs: | |
build-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Prepare OCR-D Manager | |
run: | | |
# Rename example .env file | |
mv .env.example .env | |
# Set environment variables from .env file | |
export $(grep -v '^#' .env | xargs) | |
# Generate ssh keys | |
mkdir -p ./ocrd/manager/.ssh | |
ssh-keygen -t rsa -q -f $MANAGER_KEY -P '' -C 'OCR-D manager key' | |
mkdir -p ./ocrd/controller/.ssh/ ./ocrd/controller/models | |
wget -O .env.ocrd-controller https://raw.githubusercontent.com/slub/ocrd_controller/master/.env.example | |
# Set environment variables from .env file | |
export $(grep -v '^#' .env.ocrd-controller | xargs) | |
# Add public key of OCR-D Manager | |
cp ${MANAGER_KEY}.pub ${CONTROLLER_KEYS} | |
# Add model | |
wget -P ${CONTROLLER_MODELS} https://ub-backup.bib.uni-mannheim.de/~stweil/tesstrain/frak2021/tessdata_best/frak2021-0.905.traineddata | |
- name: Build | |
run: docker compose build | |
- name: Start | |
run: docker compose up -d | |
- name: Test | |
run: make test | |
- name: Setup upterm session when failure | |
if: ${{ failure() && github.event_name == 'workflow_dispatch' }} | |
uses: lhotari/action-upterm@v1 | |