From 9e53c79ef3b58bb91e997a056b9701477b873d48 Mon Sep 17 00:00:00 2001 From: j4y <36337+j4y@users.noreply.github.com> Date: Mon, 19 Jan 2026 09:48:08 -0500 Subject: [PATCH] refactor: remove Rake, migrate workflows and tooling to mise --- .github/workflows/deploy.yml | 5 +--- .github/workflows/test.yml | 17 ++++++------ .rubocop.yml | 2 -- Gemfile | 2 -- Gemfile.lock | 5 ---- README.md | 32 +++++++++------------- Rakefile | 52 ------------------------------------ _config.yml | 3 +-- mise.toml | 34 ++++++++++++++++++++--- 9 files changed, 55 insertions(+), 97 deletions(-) delete mode 100644 Rakefile diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bd410a5..39ccb8e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,9 +12,6 @@ on: workflow_dispatch: env: - # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # AWS_DEFAULT_REGION: us-east-1 working_dir: terragrunt/live/website concurrency: @@ -71,7 +68,7 @@ jobs: - name: Build Jekyll project run: | bundle install - bundle exec rake build + mise build - name: Validate Outputs run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a5d0b1b..afcdd5e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,10 +15,14 @@ jobs: steps: - uses: actions/checkout@v6 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Install mise + uses: jdx/mise-action@v3 + + - name: Install tools + run: mise install + + - name: Install Ruby gems + run: bundle install - name: Setup TFLint uses: terraform-linters/setup-tflint@v6 @@ -26,10 +30,7 @@ jobs: tflint_version: v0.50.3 - name: Run linters - run: bundle exec rake lint - # needed to add new pages - continue-on-error: true - + run: mise lint - uses: actions/setup-node@v6 with: diff --git a/.rubocop.yml b/.rubocop.yml index 0aec27c..3b64504 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,4 +1,2 @@ -plugins: - - rubocop-rake AllCops: NewCops: enable diff --git a/Gemfile b/Gemfile index 3ceb19f..846bd6e 100644 --- a/Gemfile +++ b/Gemfile @@ -8,6 +8,4 @@ gem 'csv' gem 'faraday' gem 'html-proofer' gem 'jekyll' -gem 'rake' gem 'rubocop', require: false -gem 'rubocop-rake' diff --git a/Gemfile.lock b/Gemfile.lock index 3635ea7..61a6153 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -179,9 +179,6 @@ GEM rubocop-ast (1.49.0) parser (>= 3.3.7.2) prism (~> 1.7) - rubocop-rake (0.7.1) - lint_roller (~> 1.1) - rubocop (>= 1.72.1) ruby-progressbar (1.13.0) ruby-rc4 (0.1.5) safe_yaml (1.0.5) @@ -237,9 +234,7 @@ DEPENDENCIES faraday html-proofer jekyll - rake rubocop - rubocop-rake RUBY VERSION ruby 3.3.9p170 diff --git a/README.md b/README.md index 17b1317..ac2b916 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,31 @@ # colorcop-website [![GitHub Actions Status](https://github.com/ColorCop/colorcop-website/workflows/Test/badge.svg)](https://github.com/ColorCop/colorcop-website/actions) -![Powered by Rake](https://img.shields.io/badge/powered_by-rake-blue?logo=ruby) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -## Installation - -This project uses mise to configure the development environment. Install it and then run `mise install`. - -Install the required ruby gems: +A static website for the ColorCop project, built with Jekyll and managed using mise for consistent tooling and reproducible development environments. -``` -bundle install -``` +--- -## Running locally +## Installation -``` -jekyll serve -``` +This project uses mise to configure the development environment. -## Running tests +- Install [mise](https://mise.jdx.dev/getting-started.html) +- Run `mise trust` and answer yes. +- Run `mise install` to install the required tools +- Run `bundle install` -There is a rake task that runs [Playwright](https://github.com/microsoft/playwright) tests. +## Running locally -``` -rake test +```sh +mise serve ``` ## Running linters -``` -rake lint +```sh +mise lint ``` ## Deploy diff --git a/Rakefile b/Rakefile deleted file mode 100644 index a73dca4..0000000 --- a/Rakefile +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -require 'html-proofer' -require 'jekyll' -require 'rubocop/rake_task' - -# add the rubocop rake task, which is called by the lint task -RuboCop::RakeTask.new - -desc 'build the Jekyll project' -task :build do - config = Jekyll.configuration - site = Jekyll::Site.new(config) - Jekyll::Commands::Build.build(site, config) -end - -desc 'serve the Jekyll project with live reload' -task :serve do - config = Jekyll.configuration( - 'watch' => true, - 'serving' => true, - 'port' => 4000, - 'host' => '127.0.0.1' - ) - - Jekyll::Commands::Serve.process(config) -end - -desc 'run playwright tests' -task :test do - sh 'npx playwright test' -end - -desc 'run linters' -task lint: :build do - # Ruby code linter - Rake::Task['rubocop'].execute - - # Terraform lint - sh 'tflint --init' - sh 'tflint --chdir terraform/website/ -c ../../.tflint.hcl' - - # HTML linting - options = { - check_html: true, - check_external_hash: true - } - - HTMLProofer.check_directory('./_site', options).run -end - -task default: %i[test lint] diff --git a/_config.yml b/_config.yml index e699241..bfa2945 100644 --- a/_config.yml +++ b/_config.yml @@ -11,11 +11,10 @@ github_username: colorcop # Build settings markdown: kramdown -# exclude some directories and files that don't belong in the website +# exclude some directories and files that shouldn't be published exclude: - terraform - terragrunt - - Rakefile - README.md - package* - playwright* diff --git a/mise.toml b/mise.toml index 573def9..57450c1 100644 --- a/mise.toml +++ b/mise.toml @@ -1,4 +1,32 @@ [tools] -ruby = '3.3.9' -terragrunt = '0.86.0' -opentofu = '1.6.2' +ruby = "3.3.9" +terragrunt = "0.86.0" +# Use a direct tarball URL so mise doesn't call the GitHub API +opentofu = { version = "1.6.2", url = "https://github.com/opentofu/opentofu/releases/download/v1.6.2/opentofu_1.6.2_linux_amd64.tar.gz" } + +[tasks.build] +description = "Build the Jekyll project" +run = "bundle exec jekyll build" + +[tasks.lint] +description = "Run all linters" +depends = ["build"] +run = [ + # Ruby lint + "bundle exec rubocop", + + # Terraform lint + "tflint --init", + "tflint --chdir terraform/website/ -c ../../.tflint.hcl", + + # HTML linting + "bundle exec htmlproofer ./_site --check-external-hash" +] + +[tasks.serve] +description = "Serve the Jekyll project with live reload" +run = "bundle exec jekyll serve --livereload --watch --port 4000 --host 127.0.0.1" + +[tasks.default] +description = "Default task" +depends = ["test", "lint"]