-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOP-22141] Add logic for handling SFTP transfers
- Loading branch information
Ilyas Gasanov
committed
Jan 27, 2025
1 parent
85618f1
commit a1c8006
Showing
17 changed files
with
1,163 additions
and
10 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: SFTP tests | ||
on: | ||
workflow_call: | ||
|
||
env: | ||
DEFAULT_PYTHON: '3.12' | ||
|
||
jobs: | ||
test: | ||
name: Run SFTP tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Cache jars | ||
uses: actions/cache@v4 | ||
with: | ||
path: ./cached_jars | ||
key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-test-sftp | ||
restore-keys: | | ||
${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-test-sftp | ||
${{ runner.os }}-python- | ||
- name: Build Worker Image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
tags: mtsrus/syncmaster-worker:${{ github.sha }} | ||
target: test | ||
file: docker/Dockerfile.worker | ||
load: true | ||
cache-from: mtsrus/syncmaster-worker:develop | ||
|
||
- name: Docker compose up | ||
run: | | ||
docker compose -f docker-compose.test.yml --profile all down -v --remove-orphans | ||
docker compose -f docker-compose.test.yml --profile sftp up -d --wait --wait-timeout 200 | ||
env: | ||
WORKER_IMAGE_TAG: ${{ github.sha }} | ||
|
||
- name: Run SFTP Tests | ||
run: | | ||
docker compose -f ./docker-compose.test.yml --profile sftp exec -T worker coverage run -m pytest -vvv -s -m "worker and sftp" | ||
- name: Dump worker logs on failure | ||
if: failure() | ||
uses: jwalton/gh-docker-logs@v2 | ||
with: | ||
images: mtsrus/syncmaster-worker | ||
dest: ./logs | ||
|
||
# This is important, as coverage is exported after receiving SIGTERM | ||
- name: Shutdown | ||
if: always() | ||
run: | | ||
docker compose -f docker-compose.test.yml --profile all down -v --remove-orphans | ||
- name: Upload worker logs | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: worker-logs-sftp | ||
path: logs/* | ||
|
||
- name: Upload coverage results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-sftp | ||
path: reports/* | ||
# https://github.com/actions/upload-artifact/issues/602 | ||
include-hidden-files: true |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add logic for handling SFTP transfers |
Oops, something went wrong.