Files
seafile-mirror/.gitea/workflows/selftests.yaml
Renovate Bot ebc0219c5c
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
Python Linters / pylint (pull_request) Successful in 35s
Python Linters / formatting (pull_request) Successful in 34s
Python Linters / mypy (pull_request) Successful in 37s
REUSE Compliance / reuse (pull_request) Successful in 49s
Selftests / test-sync (pull_request) Successful in 1m0s
Selftests / test-build-install (pull_request) Successful in 1m26s
chore(deps): update actions/checkout action to v6
2025-11-24 01:21:46 +00:00

60 lines
1.8 KiB
YAML

# SPDX-FileCopyrightText: 2023 DB Systel GmbH
# SPDX-FileCopyrightText: 2023 Max Mehl <https://mehl.mx>
#
# SPDX-License-Identifier: Apache-2.0
name: Selftests
on:
push:
branches:
- main
pull_request:
jobs:
# Test building the package and installing it via pip3
test-build-install:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Add pipx to PATH
run: echo "/root/.local/bin" >> ${GITHUB_PATH}
- name: Install poetry
run: pipx install poetry
- name: Build package
run: poetry build
- name: Install package
run: pip3 install dist/seafile_mirror-*.tar.gz
- name: Run package
run: |
seafile-mirror --version
seafile-mirror --help
# Run tool and sync a test library
test-sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install dependencies
uses: ./.gitea/actions/poetrybuild
# using minimal set of dependencies
with:
poetry_install_args: "--without dev"
- name: Install seaf-cli
run: |
apt-get update
apt-get install -y seafile-cli
- name: Configure seaf-cli and start daemon
run: |
seaf-cli init -d /tmp
seaf-cli start
- name: Fill configuration for test library
run: |
sed -i "s|__seafile_server__|${{ secrets.SEAFILE_SERVER }}|" tests/seafile_mirror.conf.yaml
sed -i "s|__seafile_user__|${{ secrets.SEAFILE_USER }}|" tests/seafile_mirror.conf.yaml
sed -i "s|__seafile_pass__|${{ secrets.SEAFILE_PASS }}|" tests/seafile_mirror.conf.yaml
- name: Sync the library
run: poetry run seafile-mirror -c tests -v
- name: Attempt to find expected string in library
run: grep "__ci_test_expect__" tests/ci-test/testfile.txt