Update TesseractOcrTests.cs #54
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: Dockerized CI with IntegrationTests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set up .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Install Docker Compose | |
run: | | |
DOCKER_COMPOSE_VERSION=2.20.2 | |
curl -L "https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
chmod +x /usr/local/bin/docker-compose | |
docker-compose version | |
shell: bash | |
- name: Start Docker Services | |
run: | | |
docker compose -f compose.yaml up --build -d | |
shell: bash | |
- name: Run Migrations | |
run: | | |
shell: bash | |
# Wait until the main REST API is up on localhost:8081 | |
# so integration tests don’t fail immediately. | |
- name: Wait for Paperless REST container | |
run: | | |
echo "Waiting up to 120 seconds for the Paperless REST container to respond on port 8081..." | |
for i in {1..24}; do | |
if curl --silent --fail http://localhost:8081/; then | |
echo "Paperless REST is up!" | |
exit 0 | |
fi | |
echo "Still waiting..." | |
sleep 5 | |
done | |
echo "Paperless REST service did not become ready in time!" | |
exit 1 | |
shell: bash | |
- name: Restore .NET Dependencies | |
run: dotnet restore | |
shell: bash | |
- name: Build .NET Solution | |
run: dotnet build --no-restore --configuration Debug | |
shell: bash | |
- name: Run Tests | |
run: dotnet test --no-build --configuration Debug --verbosity normal | |
shell: bash | |
- name: Cleanup Docker Services | |
if: always() | |
run: docker compose -f compose.yaml down --volumes | |
shell: bash |