Skip to content

Add WebDav tests

Add WebDav tests #114

Workflow file for this run

# 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
services:
sftp:
image: atmoz/sftp:latest
ports:
- 2222:22
options: >-
--health-cmd "pgrep sshd"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
SFTP_USERS: testuser:testpass:1001:100:upload
ftp:
image: fauria/vsftpd:latest
ports:
- 21:21
- 21000-21010:21000-21010
options: >-
--health-cmd "pgrep vsftpd"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
FTP_USER: testuser
FTP_PASS: testpass
PASV_ADDRESS: localhost
PASV_MIN_PORT: 21000
PASV_MAX_PORT: 21010
localstack:
image: localstack/localstack:latest
ports:
- 4566:4566
options: >-
--health-cmd "curl -f http://localhost:4566/_localstack/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
SERVICES: s3
DEBUG: 0
EDGE_PORT: 4566
webdav:
image: hacdias/webdav:latest
ports:
- 8080:6065
options: >-
--health-cmd "wget -q --spider http://localhost:6065/ || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-start-period 60s
env:
WEBDAV_USERNAME: testuser
WEBDAV_PASSWORD: testpass
steps:
- uses: actions/checkout@v6
- name: Wait for services to be ready
run: |
echo "=== Waiting for services to be ready ==="
sleep 10
- 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 $(docker ps -q -f ancestor=localstack/localstack:latest) 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: ""