Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into feature/similar-videos
Browse files Browse the repository at this point in the history
  • Loading branch information
crohr committed Sep 6, 2023
2 parents 5f4d277 + 16828e2 commit cde60c2
Show file tree
Hide file tree
Showing 127 changed files with 7,341 additions and 3,870 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MEILI_MASTER_KEY=your local meili master key but in therory meilisearch can run without master key in development mode
YOUTUBE_API_KEY=useful for scraping youtube videos but the app can run without it
GITHUB_TOKEN=useful for the profile enhancement feature but the app can run without it
RUBYVIDEO_GITHUB_TOKEN=useful for the profile enhancement feature but the app can run without it
OPENAI_ACCESS_TOKEN="change_me"
27 changes: 27 additions & 0 deletions .erb-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
EnableDefaultLinters: true
glob: "**/*.{html}{+*,}.erb"
exclude:
- vendor/bundle/**/*
- node_modules/**/*
- tmp/**/*
- log/**/*

linters:
ErbSafety:
enabled: true
PartialInstanceVariable:
enabled: true

Rubocop:
enabled: true
rubocop_config:
require: standard
inherit_gem:
standard: config/base.yml
Layout/InitialIndentation:
Enabled: false
Layout/TrailingEmptyLines:
Enabled: false
Lint/UselessAssignment:
Enabled: false
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": "standard" }
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: linters

on:
pull_request:
branches:
- "*"
push:
branches:
- main

concurrency: ci-${{ github.ref }}

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler: default
bundler-cache: true

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: StandardRB Check
run: bundle exec standardrb

- name: StandardJS Check
run: yarn standard

- name: erb-lint Check
run: bundle exec erblint --lint-all
test:
runs-on: ubuntu-latest
env:
RAILS_ENV: test
steps:
- uses: actions/checkout@v3

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler: default
bundler-cache: true

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build assets
run: bin/vite build --clear --mode=test

- name: Prepare database
run: |
bin/rails db:create
bin/rails db:schema:load
- name: Run tests
run: |
bin/rails test
bin/rails test:system
# - name: Smoke test database seeds
# run: sudo bin/rails db:reset
57 changes: 0 additions & 57 deletions .github/workflows/deploy.yml

This file was deleted.

11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

/node_modules

/script
/script_tmp
.env
.byebug_history

Expand All @@ -47,6 +47,13 @@

/data.ms
/data_tmp
/meili_data
/data_preparation/**/*
!/data_preparation/organisations.yml

/config/credentials/production.key

test-run-report*

# Ignore SQLite databases create by Litestack for action cable to be removed once we are able to move them to storage
db/*.db
db/*.db-*
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss",
"testdouble.vscode-standard-ruby"
]
}
32 changes: 30 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,41 @@
{
"editor.detectIndentation": false,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.minimap.enabled": false,
"editor.multiCursorModifier": "ctrlCmd",
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.rulers": [80, 120],
"editor.renderControlCharacters": true,
"editor.snippetSuggestions": "top",
"editor.trimAutoWhitespace": true,
"editor.useTabStops": true,
"editor.scrollBeyondLastLine": true,
"editor.showFoldingControls": "always",
"emmet.triggerExpansionOnTab": true,
"emmet.includeLanguages": {
"html.erb": "html",
"erb": "html"
},
"emmet.triggerExpansionOnTab": true,
"files.associations": {
"*.html.erb": "erb"
},
"[ruby]": {
"editor.defaultFormatter": "testdouble.vscode-standard-ruby"
},
"rubyLsp.enabledFeatures": {
"diagnostics": false
}
},
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"tailwindCSS.includeLanguages": {
"erb": "html"
},
"tailwindCSS.emmetCompletions": true,
"tailwindCSS.validate": true
}
12 changes: 8 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ gem "turbo-rails"
# gem "cssbundling-rails"

# Use Redis adapter to run Action Cable in production
gem "redis", ">= 4.0.1"
# gem "redis", ">= 4.0.1"

# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"
Expand Down Expand Up @@ -58,29 +58,31 @@ group :development do
gem "web-console"

# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
# gem "rack-mini-profiler"
gem "rack-mini-profiler"

# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"

gem "error_highlight", ">= 0.4.0", platforms: [:ruby]
gem "ruby-lsp", "~> 0.5.1", require: false
gem "standardrb", "~> 1.0"
gem "erb_lint", "~> 0.4.0"
gem "authentication-zero", "~> 2.16"
end

group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem "capybara"
gem "rails-controller-testing"
gem "selenium-webdriver"
gem "webdrivers"
gem "vcr", "~> 6.1"
gem "webmock"
end

gem "pagy", "~> 6.0"
gem "dockerfile-rails", ">= 1.2", group: :development
gem "litestack", "~> 0.2.3"
gem "litestack"
# gem "litestack", git: "[email protected]:oldmoe/litestack.git", branch: "master"
gem "inline_svg", "~> 1.9"
gem "net-http", "~> 0.3.2"
gem "meilisearch-rails", "~> 0.9.1"
Expand All @@ -92,3 +94,5 @@ gem "groupdate", "~> 6.2"

gem "appsignal", "~> 3.4"
gem "ruby-openai"

gem "chartkick", "~> 5.0"
Loading

0 comments on commit cde60c2

Please sign in to comment.