diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ba6a994 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,75 @@ +name: CI + +on: + pull_request: + push: + branches: [ main ] + +jobs: + scan_ruby: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Scan for common Rails security vulnerabilities using static analysis + run: bin/brakeman --no-pager + + scan_js: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Scan for security vulnerabilities in JavaScript dependencies + run: bin/importmap audit + + test: + runs-on: ubuntu-latest + + # services: + # redis: + # image: redis + # ports: + # - 6379:6379 + # options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 + steps: + - name: Install packages + run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config google-chrome-stable + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Run tests + env: + RAILS_ENV: test + # REDIS_URL: redis://localhost:6379/0 + run: bin/rails db:test:prepare test test:system + + - name: Keep screenshots from failed system tests + uses: actions/upload-artifact@v4 + if: failure() + with: + name: screenshots + path: ${{ github.workspace }}/tmp/screenshots + if-no-files-found: ignore diff --git a/app/components/button_component.html.erb b/app/components/button_component.html.erb index e64e0f5..8641069 100644 --- a/app/components/button_component.html.erb +++ b/app/components/button_component.html.erb @@ -1,4 +1,3 @@ - diff --git a/app/components/button_component.rb b/app/components/button_component.rb index 6f5e8e0..04796a8 100644 --- a/app/components/button_component.rb +++ b/app/components/button_component.rb @@ -1,4 +1,3 @@ - class ButtonComponent < ViewComponent::Base def initialize(type: :submit, style: :primary, full_width: true, name: nil) @type = type diff --git a/app/components/dashboard/profile_form_header_component.rb b/app/components/dashboard/profile_form_header_component.rb index 69a9fbb..f119fc1 100644 --- a/app/components/dashboard/profile_form_header_component.rb +++ b/app/components/dashboard/profile_form_header_component.rb @@ -1,4 +1,3 @@ - # app/components/dashboard/profile_form_header_component.rb class Dashboard::ProfileFormHeaderComponent < ViewComponent::Base # update_href: PATCH endpoint (e.g., dashboard_path) diff --git a/app/components/footer_component.html.erb b/app/components/footer_component.html.erb index 71e1d82..3dd18fa 100644 --- a/app/components/footer_component.html.erb +++ b/app/components/footer_component.html.erb @@ -1,4 +1,3 @@ -