From 96bf486ad27759cf0022f8c66f8a29b1445430e7 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sun, 19 May 2024 23:24:47 -0300 Subject: [PATCH] Add "rake ci" --- .github/workflows/al-quran.yml | 26 ++---------------------- Rakefile.rb | 1 + rake/tasks/ci.rake | 9 ++++++++ src/js/components/SurahStream/Stream.tsx | 2 +- 4 files changed, 13 insertions(+), 25 deletions(-) create mode 100644 rake/tasks/ci.rake diff --git a/.github/workflows/al-quran.yml b/.github/workflows/al-quran.yml index 2a3ef81a5..cad84e225 100644 --- a/.github/workflows/al-quran.yml +++ b/.github/workflows/al-quran.yml @@ -17,27 +17,5 @@ jobs: uses: actions/checkout@v2 - name: Prepare environment uses: './.github/actions/prepare-env' - - name: eslint - run: npm exec eslint -- src/js/ - - name: rubocop - run: bundle exec rubocop - prettier: - runs-on: ubuntu-latest - steps: - - name: Clone - uses: actions/checkout@v2 - - name: Prepare environment - uses: './.github/actions/prepare-env' - - name: prettier - run: npm exec prettier -- --check src/js/ - build: - runs-on: ubuntu-latest - steps: - - name: Clone - uses: actions/checkout@v2 - - name: Prepare environment - uses: './.github/actions/prepare-env' - - name: Add HTMLTidy - run: sudo apt-get install tidy - - name: nanoc - run: rake nanoc:build + - name: ci + run: rake ci diff --git a/Rakefile.rb b/Rakefile.rb index a2dde6869..b064151a5 100644 --- a/Rakefile.rb +++ b/Rakefile.rb @@ -14,6 +14,7 @@ end load "rake/tasks/format.rake" load "rake/tasks/nanoc.rake" load "rake/tasks/t.rake" +load "rake/tasks/ci.rake" desc "Serve the website on localhost" task :server, [:protocol] do |_t, args| diff --git a/rake/tasks/ci.rake b/rake/tasks/ci.rake new file mode 100644 index 000000000..70eb86f94 --- /dev/null +++ b/rake/tasks/ci.rake @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +desc "Run CI tasks" +task :ci do + sh "bundle exec rubocop" + sh "npm exec eslint -- src/js/" + sh "npm exec prettier -- --check src/js/" + Bundler.with_original_env { sh "rake nanoc:clean nanoc:build" } +end diff --git a/src/js/components/SurahStream/Stream.tsx b/src/js/components/SurahStream/Stream.tsx index b4bf111ee..275ffc97b 100644 --- a/src/js/components/SurahStream/Stream.tsx +++ b/src/js/components/SurahStream/Stream.tsx @@ -25,7 +25,7 @@ export function Stream({ locale, surah, stream, endOfStream, isPaused, t }: Prop className={classNames( "body stream scroll-y list-none p-0 m-0 h-5/6", ...className, - {"mt-4": ltr, "mt-6": rtl} + { "mt-4": ltr, "mt-6": rtl }, )} ref={ref} >