From 95335de48b53d4315c30697d1e060d0c7072a236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Sat, 8 Aug 2026 07:58:52 -0600 Subject: [PATCH] Migrate from Drone CI to Gitea Actions --- .drone.yml | 61 ----------------------------------------- .gitea/workflows/ci.yml | 57 ++++++++++++++++++++++++++++++++++++++ README.md | 2 +- ci/Dockerfile | 10 ------- 4 files changed, 58 insertions(+), 72 deletions(-) delete mode 100644 .drone.yml create mode 100644 .gitea/workflows/ci.yml delete mode 100644 ci/Dockerfile diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 90d510d..0000000 --- a/.drone.yml +++ /dev/null @@ -1,61 +0,0 @@ ---- -kind: pipeline -type: docker -name: CI build - -steps: - - name: restore-cache - image: drillster/drone-volume-cache - volumes: - - name: cache - path: /cache - settings: - restore: true - mount: - - ./vendor/cache - when: - branch: - - master - - name: rspec - image: gitea.kosmos.org/kosmos/akkounts-ci:0.9.1 - environment: - RAILS_ENV: test - REDIS_URL: redis://redis:6379/0 - RS_REDIS_URL: redis://redis:6379/1 - commands: - - bundle config unset deployment - - bundle config set cache_all 'true' - - bundle config set cache_path 'vendor/cache' - - bundle config set with 'development test' - - bundle install --jobs=3 --retry=3 - - bundle exec rails db:create - - bundle exec rails db:migrate - - yarn install - - rake css:build - - bundle exec rspec - - name: rebuild-cache - image: drillster/drone-volume-cache - volumes: - - name: cache - path: /cache - settings: - rebuild: true - mount: - - ./vendor/cache - when: - branch: - - master - -services: - - name: redis - image: redis - -volumes: - - name: cache - host: - path: /var/lib/drone/tmp ---- -kind: signature -hmac: f9a8cf97f6596625721365f6238f6f298aa5a7a4de10c3fb61c57202ae9d1ee1 - -... diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..799196a --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,57 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + +jobs: + test: + name: Test + runs-on: ubuntu-latest + container: ruby:3.3.0 + services: + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + RAILS_ENV: test + REDIS_URL: redis://redis:6379/0 + RS_REDIS_URL: redis://redis:6379/1 + steps: + - uses: actions/checkout@v4 + + - name: Install system dependencies + run: | + apt-get update -qq + apt-get install -y --no-install-recommends ldap-utils libvips tini + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: yarn + + - name: Set up Ruby and bundle cache + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.3.0 + bundler-cache: true + + - name: Prepare database + run: | + bundle exec rails db:create + bundle exec rails db:migrate + + - name: Install JS dependencies + run: yarn install --frozen-lockfile + + - name: Build CSS + run: bundle exec rake css:build + + - name: Run tests + run: bundle exec rspec diff --git a/README.md b/README.md index 4b69035..92ba99c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://drone.kosmos.org/api/badges/kosmos/akkounts/status.svg)](https://drone.kosmos.org/kosmos/akkounts) +[![Build Status](https://gitea.kosmos.org/kosmos/akkounts/actions/workflows/ci.yml/badge.svg)](https://gitea.kosmos.org/kosmos/akkounts/actions) # Akkounts diff --git a/ci/Dockerfile b/ci/Dockerfile deleted file mode 100644 index d595128..0000000 --- a/ci/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM ruby:3.3.0 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -RUN apt-get update -qq && apt-get install -y --no-install-recommends curl \ - ldap-utils tini libvips -RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - -RUN apt-get update && apt-get install -y nodejs -RUN npm install -g yarn