diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cbc4fe9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Run tests + run: | + python -m unittest test_sbg.py diff --git a/README.md b/README.md index 679ac17..f3cf778 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # GitLab Group Cloner & Updater +[![CI](https://github.com/tutunak/sb-gitlab/actions/workflows/ci.yml/badge.svg)](https://github.com/sb-gitlab/sb-gitlab/actions/workflows/ci.yml) + A command-line Python tool to **clone** or **update** (_pull_) **all** GitLab repositories under one or more groups (including nested subgroups), organizing them into a mirror directory tree that matches each project’s namespace. --- @@ -41,7 +43,7 @@ A command-line Python tool to **clone** or **update** (_pull_) **all** GitLab re ## Usage ```bash -python clone_or_update_groups_by_namespace.py \ +python sbg.py \ --gitlab-url \ --token \ --group-ids [ …] \ @@ -69,7 +71,7 @@ Arguments: Clone or update all projects under group **42** into `./repos` via HTTPS: ```bash -python clone_or_update_groups_by_namespace.py \ +python sbg.py \ --gitlab-url https://gitlab.com \ --token $GITLAB_TOKEN \ --group-ids 42 \ @@ -79,7 +81,7 @@ python clone_or_update_groups_by_namespace.py \ Clone or update projects from two groups by full path, using SSH: ```bash -python clone_or_update_groups_by_namespace.py \ +python sbg.py \ --gitlab-url https://gitlab.example.com \ --token $GITLAB_TOKEN \ --group-ids team/backend team/frontend \