mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-24 15:00:43 +02:00
* ci: skip setup-go cache on self-hosted runners The module cache is already local on a persistent self-hosted runner; archiving ~/go/pkg/mod into cache.tzst at every job's end is pure cost and can stall (a ~4-minute zstdmt hang was observed on awscli-tests). runner.environment gates the cache to GitHub-hosted runners only. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * ci: gate the remaining setup-go caches too The first pass only covered go-version-file steps; go-version steps in nine workflows (including awscli-tests' own file) kept uploading the cache archive on self-hosted runners. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
95 lines
3.1 KiB
YAML
95 lines
3.1 KiB
YAML
name: "SFTP Integration Tests"
|
|
|
|
on:
|
|
push:
|
|
branches: [ master, main ]
|
|
paths:
|
|
- 'weed/sftpd/**'
|
|
- 'weed/command/sftp.go'
|
|
- 'test/sftp/**'
|
|
- '.github/workflows/sftp-tests.yml'
|
|
pull_request:
|
|
branches: [ master, main ]
|
|
paths:
|
|
- 'weed/sftpd/**'
|
|
- 'weed/command/sftp.go'
|
|
- 'test/sftp/**'
|
|
- '.github/workflows/sftp-tests.yml'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.event_name == 'push' && github.ref) || github.run_id }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) }}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
TEST_TIMEOUT: '15m'
|
|
|
|
jobs:
|
|
sftp-integration:
|
|
name: SFTP Integration Testing
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 20
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: ${{ runner.environment == 'github-hosted' }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y openssh-client
|
|
|
|
- name: Build SeaweedFS
|
|
run: |
|
|
cd weed
|
|
go build -o weed .
|
|
chmod +x weed
|
|
./weed version
|
|
|
|
- name: Run SFTP Integration Tests
|
|
run: |
|
|
cd test/sftp
|
|
|
|
echo "🧪 Running SFTP integration tests..."
|
|
echo "============================================"
|
|
|
|
# Install test dependencies
|
|
go mod download
|
|
|
|
# Run all SFTP tests
|
|
go test -v -timeout=${{ env.TEST_TIMEOUT }} ./...
|
|
|
|
echo "============================================"
|
|
echo "✅ SFTP integration tests completed"
|
|
|
|
- name: Test Summary
|
|
if: always()
|
|
run: |
|
|
echo "## 🔐 SFTP Integration Test Summary" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "### Test Coverage" >> $GITHUB_STEP_SUMMARY
|
|
echo "- ✅ **HomeDir Path Translation**: User home directory mapping (fixes #7470)" >> $GITHUB_STEP_SUMMARY
|
|
echo "- ✅ **File Operations**: Upload, download, delete" >> $GITHUB_STEP_SUMMARY
|
|
echo "- ✅ **Directory Operations**: Create, list, remove" >> $GITHUB_STEP_SUMMARY
|
|
echo "- ✅ **Large File Handling**: 1MB+ file support" >> $GITHUB_STEP_SUMMARY
|
|
echo "- ✅ **Path Edge Cases**: Unicode, trailing slashes, .. paths" >> $GITHUB_STEP_SUMMARY
|
|
echo "- ✅ **Admin Access**: Root user verification" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "### Test Configuration" >> $GITHUB_STEP_SUMMARY
|
|
echo "| User | HomeDir | Permissions |" >> $GITHUB_STEP_SUMMARY
|
|
echo "|------|---------|-------------|" >> $GITHUB_STEP_SUMMARY
|
|
echo "| admin | / | Full access |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| testuser | /sftp/testuser | Home directory only |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| readonly | /public | Read-only |" >> $GITHUB_STEP_SUMMARY
|
|
|
|
|
|
|