Skip to content

Commit

Permalink
feat: Setup CI (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eth3rnit3 committed Jan 29, 2024
1 parent f061731 commit bdcfec3
Show file tree
Hide file tree
Showing 83 changed files with 466 additions and 62 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/gem-push.yml
@@ -0,0 +1,51 @@
name: Publish on RubyGems

on:
release:
types: [published]

jobs:
build:
name: Build + Publish
runs-on: ubuntu-latest
strategy:
matrix:
ruby:
- '3.2.2'
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Publish to GPR
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
env:
GEM_HOST_API_KEY: "Bearer ${{secrets.CI_GITHUB_TOKEN}}"
OWNER: ${{ github.repository_owner }}
GEM_PUSHER: github

- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEM_API_KEY}}"
GEM_PUSHER: default
34 changes: 34 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,34 @@
name: AdministrateTailwindTheme CI

on:
push:
branches:
- "*"

pull_request:

jobs:
build:
runs-on: ubuntu-latest
name: Run linter and test
strategy:
matrix:
ruby:
- '3.2.2'

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Run Rubycritic
run: bundle exec rubycritic

- name: Run Rubocop
run: bundle exec rubocop

- name: Run Tests
run: bin/test
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -9,3 +9,4 @@
/test/dummy/storage/
/test/dummy/tmp/
.byebug_history
*.gem
33 changes: 33 additions & 0 deletions .rubocop.yml
@@ -0,0 +1,33 @@
AllCops:
Exclude:
- 'administrate_tailwind_theme.gemspec'
- 'test/dummy/**/*.rb'
- 'vendor/**/*'
NewCops: enable
TargetRubyVersion: 3.0

Style/StringLiterals:
Enabled: true
EnforcedStyle: single_quotes

Style/Documentation:
Enabled: false

Style/StringLiteralsInInterpolation:
Enabled: true
EnforcedStyle: double_quotes

Layout/LineLength:
Max: 120

Metrics/AbcSize:
Max: 30

Metrics/MethodLength:
Max: 30

Metrics/BlockLength:
Max: 100

Metrics/ParameterLists:
Max: 6
1 change: 1 addition & 0 deletions .ruby-version
@@ -0,0 +1 @@
3.2.2
5 changes: 5 additions & 0 deletions .rubycritic.yml
@@ -0,0 +1,5 @@
minimum_score: 90
paths:
- 'lib/'
- 'app/'
no_browser: true
9 changes: 9 additions & 0 deletions Gemfile
@@ -1,13 +1,22 @@
# frozen_string_literal: true

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# Specify your gem's dependencies in administrate_tailwind_theme.gemspec.
gemspec

gem 'irb', '~> 1.9.1'
gem 'puma'
gem 'sprockets-rails'
gem 'sqlite3'

group :development do
gem 'rubocop', '~> 1.21'
gem 'rubocop-rake', '~> 0.6.0'
gem 'rubycritic', '~> 4.9.0'
end

group :test do
gem 'administrate'
gem 'capybara'
Expand Down
123 changes: 120 additions & 3 deletions Gemfile.lock
Expand Up @@ -4,7 +4,7 @@ PATH
administrate_tailwind_theme (0.0.1)
administrate (~> 0.15)
iso_country_codes (~> 0.7.8)
rails (>= 7.1.3)
rails (~> 7.1, >= 7.1.3)
tailwindcss-rails (~> 2.0)

GEM
Expand Down Expand Up @@ -94,6 +94,11 @@ GEM
kaminari (~> 1.2.2)
sassc-rails (~> 2.1)
selectize-rails (~> 0.6)
ast (2.4.2)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
base64 (0.2.0)
bigdecimal (3.1.6)
builder (3.2.4)
Expand All @@ -107,27 +112,70 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
crass (1.0.6)
date (3.3.4)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
docile (1.4.0)
drb (2.2.0)
ruby2_keywords
dry-configurable (1.1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-core (1.0.1)
concurrent-ruby (~> 1.0)
zeitwerk (~> 2.6)
dry-inflector (1.0.0)
dry-initializer (3.1.1)
dry-logic (1.5.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-schema (1.13.3)
concurrent-ruby (~> 1.0)
dry-configurable (~> 1.0, >= 1.0.1)
dry-core (~> 1.0, < 2)
dry-initializer (~> 3.0)
dry-logic (>= 1.4, < 2)
dry-types (>= 1.7, < 2)
zeitwerk (~> 2.6)
dry-types (1.7.2)
bigdecimal (~> 3.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0)
dry-inflector (~> 1.0)
dry-logic (~> 1.4)
zeitwerk (~> 2.6)
erubi (1.12.0)
ffi (1.16.3)
flay (2.13.1)
erubi (~> 1.10)
path_expander (~> 1.0)
ruby_parser (~> 3.0)
sexp_processor (~> 4.0)
flog (4.8.0)
path_expander (~> 1.0)
ruby_parser (~> 3.1, > 3.1.0)
sexp_processor (~> 4.8)
globalid (1.2.1)
activesupport (>= 6.1)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
io-console (0.7.2)
irb (1.11.1)
irb (1.9.1)
rdoc
reline (>= 0.4.2)
reline (>= 0.3.8)
iso_country_codes (0.7.8)
jquery-rails (4.6.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.7.1)
kaminari (1.2.2)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.2)
Expand All @@ -140,6 +188,9 @@ GEM
activerecord
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
language_server-protocol (3.17.0.3)
launchy (2.5.2)
addressable (~> 2.8)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -167,6 +218,13 @@ GEM
racc (~> 1.4)
nokogiri (1.16.0-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.0-x86_64-linux)
racc (~> 1.4)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
path_expander (1.1.1)
psych (5.1.2)
stringio
public_suffix (5.0.4)
Expand Down Expand Up @@ -210,14 +268,51 @@ GEM
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.1.0)
rdoc (6.6.2)
psych (>= 4.0.0)
reek (6.3.0)
dry-schema (~> 1.13.0)
parser (~> 3.3.0)
rainbow (>= 2.0, < 4.0)
rexml (~> 3.1)
regexp_parser (2.9.0)
reline (0.4.2)
io-console (~> 0.5)
rexml (3.2.6)
rubocop (1.60.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
ruby_parser (3.21.0)
racc (~> 1.5)
sexp_processor (~> 4.16)
rubycritic (4.9.0)
flay (~> 2.13)
flog (~> 4.7)
launchy (>= 2.5.2)
parser (>= 3.2.2.1)
rainbow (~> 3.1.1)
reek (~> 6.0, < 7.0)
rexml
ruby_parser (~> 3.20)
simplecov (>= 0.22.0)
tty-which (~> 0.5.0)
virtus (~> 2.0)
rubyzip (2.3.2)
sassc (2.4.0)
ffi (~> 1.9)
Expand All @@ -233,6 +328,13 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sexp_processor (4.17.1)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
Expand All @@ -242,16 +344,26 @@ GEM
sprockets (>= 3.0.0)
sqlite3 (1.7.1-arm64-darwin)
sqlite3 (1.7.1-x86_64-darwin)
sqlite3 (1.7.1-x86_64-linux)
stringio (3.1.0)
tailwindcss-rails (2.3.0-arm64-darwin)
railties (>= 6.0.0)
tailwindcss-rails (2.3.0-x86_64-darwin)
railties (>= 6.0.0)
tailwindcss-rails (2.3.0-x86_64-linux)
railties (>= 6.0.0)
thor (1.3.0)
thread_safe (0.3.6)
tilt (2.3.0)
timeout (0.4.1)
tty-which (0.5.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
virtus (2.0.0)
axiom-types (~> 0.1)
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
webrick (1.8.1)
websocket (1.2.10)
websocket-driver (0.7.6)
Expand All @@ -264,13 +376,18 @@ GEM
PLATFORMS
arm64-darwin-23
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
administrate
administrate_tailwind_theme!
byebug
capybara
irb (~> 1.9.1)
puma
rubocop (~> 1.21)
rubocop-rake (~> 0.6.0)
rubycritic (~> 4.9.0)
selenium-webdriver
sprockets-rails
sqlite3
Expand Down
2 changes: 2 additions & 0 deletions README.md
@@ -1,4 +1,6 @@
# administrate_tailwind_theme Gem
[![AdministrateTailwindTheme CI](https://github.com/Eth3rnit3/administrate-tailwind-theme/actions/workflows/main.yml/badge.svg)](https://github.com/Eth3rnit3/administrate-tailwind-theme/actions/workflows/main.yml)
[![Publish on RubyGems](https://github.com/Eth3rnit3/administrate-tailwind-theme/actions/workflows/gem-push.yml/badge.svg)](https://github.com/Eth3rnit3/administrate-tailwind-theme/actions/workflows/gem-push.yml)

## Introduction
`administrate_tailwind_theme` is a custom theme gem for the [Administrate](https://github.com/thoughtbot/administrate) gem, utilizing the [Tailwind CSS](https://tailwindcss.com/) framework. This gem revamps all views to use Tailwind CSS classes, enhancing the visual aesthetics and responsiveness of your Administrate dashboard. It also introduces additional fields like BooleanEmoji and CountryEmoji for a richer admin interface.
Expand Down

0 comments on commit bdcfec3

Please sign in to comment.