Compare commits
5 Commits
0923a6e6a6
...
v0.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
| bca361ab95 | |||
| 400db96e3e | |||
| 4250475933 | |||
| 60455082c2 | |||
| 86a64570c5 |
@@ -3,11 +3,17 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
name: "Reusable Poetry build workflow"
|
name: "Reusable Poetry build workflow"
|
||||||
|
inputs:
|
||||||
|
poetry_install_args:
|
||||||
|
default: ""
|
||||||
|
description: "Value for additional poetry install arguments"
|
||||||
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Install dependencies
|
- name: Install poetry
|
||||||
run: |
|
run: pip install poetry
|
||||||
pip install poetry
|
- name: Install poetry package
|
||||||
poetry install --no-interaction
|
run: poetry install --no-interaction ${{ inputs.poetry_install_args }}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
41
.gitea/workflows/linting.yaml
Normal file
41
.gitea/workflows/linting.yaml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# SPDX-FileCopyrightText: 2023 Max Mehl <https://mehl.mx>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
name: Python Linters
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pylint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install dependencies
|
||||||
|
uses: ./.gitea/actions/poetrybuild
|
||||||
|
- name: Lint with pylint
|
||||||
|
run: poetry run pylint seafile_mirror
|
||||||
|
|
||||||
|
formatting:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install dependencies
|
||||||
|
uses: ./.gitea/actions/poetrybuild
|
||||||
|
- name: Test formatting with isort and black
|
||||||
|
run: |
|
||||||
|
poetry run isort --check seafile_mirror/
|
||||||
|
poetry run black .
|
||||||
|
|
||||||
|
mypy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install dependencies
|
||||||
|
uses: ./.gitea/actions/poetrybuild
|
||||||
|
- name: Test typing with mypy
|
||||||
|
run: poetry run mypy
|
||||||
@@ -12,7 +12,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build and publish to pypi
|
- name: Build and publish to PyPI
|
||||||
uses: https://github.com/JRubics/poetry-publish@v1.17
|
uses: https://github.com/JRubics/poetry-publish@v1.17
|
||||||
with:
|
with:
|
||||||
pypi_token: ${{ secrets.PYPI_TOKEN }}
|
pypi_token: ${{ secrets.PYPI_TOKEN }}
|
||||||
|
|||||||
19
.gitea/workflows/reuse.yaml
Normal file
19
.gitea/workflows/reuse.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# SPDX-FileCopyrightText: 2023 Max Mehl <https://mehl.mx>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
name: REUSE Compliance
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
reuse:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Check REUSE Compliance
|
||||||
|
uses: https://github.com/fsfe/reuse-action@v2
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
name: Test suites
|
name: Selftests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -29,12 +29,15 @@ jobs:
|
|||||||
seafile-mirror --help
|
seafile-mirror --help
|
||||||
|
|
||||||
# Run tool and sync a test library
|
# Run tool and sync a test library
|
||||||
selftest:
|
test-sync:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.gitea/actions/poetrybuild
|
uses: ./.gitea/actions/poetrybuild
|
||||||
|
# using minimal set of dependencies
|
||||||
|
with:
|
||||||
|
poetry_install_args: "--without dev"
|
||||||
- name: Install seaf-cli
|
- name: Install seaf-cli
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
@@ -52,41 +55,3 @@ jobs:
|
|||||||
run: poetry run seafile-mirror -c tests -v
|
run: poetry run seafile-mirror -c tests -v
|
||||||
- name: Attempt to find expected string in library
|
- name: Attempt to find expected string in library
|
||||||
run: grep "__ci_test_expect__" tests/ci-test/testfile.txt
|
run: grep "__ci_test_expect__" tests/ci-test/testfile.txt
|
||||||
|
|
||||||
# PYLINT / BLACK / ISORT / MYPY
|
|
||||||
pylint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Install dependencies
|
|
||||||
uses: ./.gitea/actions/poetrybuild
|
|
||||||
- name: Lint with pylint
|
|
||||||
run: poetry run pylint seafile_mirror
|
|
||||||
|
|
||||||
formatting:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Install dependencies
|
|
||||||
uses: ./.gitea/actions/poetrybuild
|
|
||||||
- name: Test formatting with isort and black
|
|
||||||
run: |
|
|
||||||
poetry run isort --check seafile_mirror/
|
|
||||||
poetry run black .
|
|
||||||
|
|
||||||
mypy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Install dependencies
|
|
||||||
uses: ./.gitea/actions/poetrybuild
|
|
||||||
- name: Test typing with mypy
|
|
||||||
run: poetry run mypy
|
|
||||||
|
|
||||||
# REUSE COMPLIANCE
|
|
||||||
reuse:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Check REUSE Compliance
|
|
||||||
uses: https://github.com/fsfe/reuse-action@v2
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,3 +8,4 @@ venv/
|
|||||||
/seafile_mirror.conf.yaml
|
/seafile_mirror.conf.yaml
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.log
|
*.log
|
||||||
|
tests/ci-test/
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "seafile-mirror"
|
name = "seafile-mirror"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
description = "Handle clean read-only (re-)syncs of Seafile libraries to mirror them"
|
description = "Handle clean read-only (re-)syncs of Seafile libraries to mirror them"
|
||||||
authors = ["Max Mehl <mail@mehl.mx>"]
|
authors = ["Max Mehl <mail@mehl.mx>"]
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
# Example configuration file for seafile-mirror
|
# Configuration file for seafile-mirror which will be filled in and applied in
|
||||||
|
# the CI test
|
||||||
- server: __seafile_server__
|
- server: __seafile_server__
|
||||||
user: __seafile_user__
|
user: __seafile_user__
|
||||||
password: __seafile_pass__
|
password: __seafile_pass__
|
||||||
|
|||||||
Reference in New Issue
Block a user