Try to reconcile dev with CI and fix tests finally #126
Workflow file for this run
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
| # This workflow will build a .NET project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
| name: .NET | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Start test services | |
| run: | | |
| echo "=== Starting test services with docker-compose ===" | |
| docker compose -f docker-compose.test.yml up -d | |
| - name: Wait for services to be ready | |
| run: | | |
| echo "=== Waiting for services to be ready ===" | |
| sleep 30 | |
| echo "=== Checking service status ===" | |
| docker compose -f docker-compose.test.yml ps | |
| echo "=== Testing WebDAV server ===" | |
| curl -f -u testuser:testpass http://localhost:8080/ || echo "WebDAV not ready yet, continuing..." | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Check format | |
| run: dotnet format --verify-no-changes | |
| - name: Build | |
| run: dotnet build --no-restore | |
| - name: Create S3 test bucket | |
| run: | | |
| docker exec sharp-sync-localstack-1 awslocal s3 mb s3://test-bucket | |
| - name: Test | |
| run: dotnet test --no-build --verbosity normal | |
| env: | |
| SFTP_TEST_HOST: localhost | |
| SFTP_TEST_PORT: 2222 | |
| SFTP_TEST_USER: testuser | |
| SFTP_TEST_PASS: testpass | |
| SFTP_TEST_ROOT: "upload" | |
| FTP_TEST_HOST: localhost | |
| FTP_TEST_PORT: 21 | |
| FTP_TEST_USER: testuser | |
| FTP_TEST_PASS: testpass | |
| FTP_TEST_ROOT: "" | |
| S3_TEST_BUCKET: test-bucket | |
| S3_TEST_ACCESS_KEY: test | |
| S3_TEST_SECRET_KEY: test | |
| S3_TEST_ENDPOINT: http://localhost:4566 | |
| S3_TEST_PREFIX: sharpsync-tests | |
| WEBDAV_TEST_URL: http://localhost:8080/ | |
| WEBDAV_TEST_USER: testuser | |
| WEBDAV_TEST_PASS: testpass | |
| WEBDAV_TEST_ROOT: "" | |
| - name: Stop test services | |
| if: always() | |
| run: | | |
| docker compose -f docker-compose.test.yml down -v --remove-orphans || true |