From 2f40140500ad83a3b6926db8ebd46d06425ca398 Mon Sep 17 00:00:00 2001 From: Sergey Besedin Date: Fri, 20 Sep 2024 03:32:36 +0400 Subject: [PATCH] Let's try gitea --- .gitea/dependabot.yml | 12 ++++++++++++ .gitea/workflows/docker-hub.yml | 33 +++++++++++++++++++++++++++++++++ .gitea/workflows/entrypoint.yml | 14 ++++++++++++++ .gitea/workflows/lint.yml | 17 +++++++++++++++++ .gitea/workflows/nix.yml | 17 +++++++++++++++++ .gitea/workflows/test.yml | 9 +++++++++ 6 files changed, 102 insertions(+) create mode 100644 .gitea/dependabot.yml create mode 100644 .gitea/workflows/docker-hub.yml create mode 100644 .gitea/workflows/entrypoint.yml create mode 100644 .gitea/workflows/lint.yml create mode 100644 .gitea/workflows/nix.yml create mode 100644 .gitea/workflows/test.yml diff --git a/.gitea/dependabot.yml b/.gitea/dependabot.yml new file mode 100644 index 0000000..d1beae0 --- /dev/null +++ b/.gitea/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 + +updates: + +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" +- package-ecosystem: "pip" + directory: "/" + schedule: + interval: "monthly" diff --git a/.gitea/workflows/docker-hub.yml b/.gitea/workflows/docker-hub.yml new file mode 100644 index 0000000..717696c --- /dev/null +++ b/.gitea/workflows/docker-hub.yml @@ -0,0 +1,33 @@ +name: Publish on Docker Hub + +on: + push: + branches: + - 'master' + tags: + - 'v*' + +jobs: + docker-hub: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: docker/metadata-action@v5 + id: meta + with: + images: nim65s/matrix-webhook + - uses: docker/setup-qemu-action@v3 + name: Set up QEMU + - uses: docker/setup-buildx-action@v3 + name: Set up Docker Buildx + - uses: docker/login-action@v3 + with: + username: nim65s + password: ${{ secrets.DOCKERHUB_TOKEN }} + - uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 diff --git a/.gitea/workflows/entrypoint.yml b/.gitea/workflows/entrypoint.yml new file mode 100644 index 0000000..7f3aa1a --- /dev/null +++ b/.gitea/workflows/entrypoint.yml @@ -0,0 +1,14 @@ +name: Test entrypoints +on: [push, pull_request] +jobs: + test-entrypoints: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - run: python -m pip install -U pip + - run: python -m pip install . + - run: matrix-webhook -h + - run: python -m matrix_webhook -h diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml new file mode 100644 index 0000000..7982014 --- /dev/null +++ b/.gitea/workflows/lint.yml @@ -0,0 +1,17 @@ +name: Lints +on: [push, pull_request] +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: pipx install poetry + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: poetry + - run: poetry install --with dev --no-interaction + - run: poetry run ruff format . + - run: poetry run ruff check . + - run: poetry run safety check --ignore 70612 + - run: poetry run poetry check diff --git a/.gitea/workflows/nix.yml b/.gitea/workflows/nix.yml new file mode 100644 index 0000000..fd854be --- /dev/null +++ b/.gitea/workflows/nix.yml @@ -0,0 +1,17 @@ +name: "Nix CI" + +on: [pull_request, push] + +jobs: + tests: + name: "Nix build on ${{ matrix.os }}" + runs-on: "${{ matrix.os }}-latest" + strategy: + matrix: + os: [ubuntu, macos] + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: DeterminateSystems/flake-checker-action@main + - run: nix build diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..219eeb9 --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,9 @@ +name: Tests +on: [push, pull_request] +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: docker compose -f test.yml up --exit-code-from tests + - uses: codecov/codecov-action@v4