All checks were successful
Python Linters / pylint (push) Successful in 40s
Python Linters / formatting (push) Successful in 37s
Python Linters / mypy (push) Successful in 37s
REUSE Compliance / reuse (push) Successful in 9s
Selftests / test-build-install (push) Successful in 40s
Selftests / test-sync (push) Successful in 1m4s
60 lines
1.8 KiB
YAML
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@v4
|
|
- 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@v4
|
|
- 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
|