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..cee584d --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,59 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + +jobs: + test: + name: Test + runs-on: ubuntu-latest + container: gitea.kosmos.org/kosmos/akkounts-ci:0.9.1 + 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: Restore bundle cache + uses: actions/cache@v4 + with: + path: vendor/bundle + key: ${{ runner.os }}-ruby-3.3.0-${{ hashFiles('Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-ruby-3.3.0- + + - name: Install Ruby dependencies + run: | + bundle config unset deployment + bundle config set cache_all 'true' + bundle config set cache_path 'vendor/cache' + bundle config set path 'vendor/bundle' + bundle config set with 'development test' + bundle install --jobs=3 --retry=3 + + - name: Prepare database + run: | + bundle exec rails db:create + bundle exec rails db:migrate + + - name: Install JS dependencies + run: yarn install + + - name: Build CSS + run: | + bundle exec rake css:build + test -s app/assets/builds/application.css + + - name: Run tests + run: bundle exec rspec diff --git a/.gitea/workflows/release_drafter.yml b/.gitea/workflows/release_drafter.yml index ba9dc39..69a6098 100644 --- a/.gitea/workflows/release_drafter.yml +++ b/.gitea/workflows/release_drafter.yml @@ -9,3 +9,5 @@ jobs: steps: - name: Release Drafter uses: https://github.com/raucao/gitea-release-drafter@dev + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 4b69035..92ba99c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[](https://drone.kosmos.org/kosmos/akkounts) +[](https://gitea.kosmos.org/kosmos/akkounts/actions) # Akkounts diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css index bba2f9b..e6f4d78 100644 --- a/app/assets/stylesheets/application.tailwind.css +++ b/app/assets/stylesheets/application.tailwind.css @@ -9,4 +9,5 @@ @import "components/forms"; @import "components/notifications"; @import "components/pagination"; +@import "components/rich_text"; @import "components/tables"; diff --git a/app/assets/stylesheets/components/rich_text.css b/app/assets/stylesheets/components/rich_text.css new file mode 100644 index 0000000..274a5e6 --- /dev/null +++ b/app/assets/stylesheets/components/rich_text.css @@ -0,0 +1,30 @@ +@layer base { + main { + .rich-text { + ul { + @apply list-disc list-inside; + + li { + @apply my-2; + } + } + + ol { + @apply list-decimal list-inside; + + li { + @apply my-2; + } + } + + li > ul, + li > ol { + @apply ps-6 my-1; + } + + hr { + @apply my-8; + } + } + } +} diff --git a/app/components/editable_content_component.html.erb b/app/components/editable_content_component.html.erb index a685f08..781ad93 100644 --- a/app/components/editable_content_component.html.erb +++ b/app/components/editable_content_component.html.erb @@ -1,6 +1,8 @@ <% if @editable_content.has_content? %> <% if @editable_content.rich_text %> - <%= helpers.markdown_to_html @editable_content.content %> +