Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevContainer and Environment Config #99

Merged
merged 6 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "shimmer",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"postCreateCommand": "bin/setup",
"remoteUser": "root",
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"GitHub.copilot",
"esbenp.prettier-vscode",
"sianglim.slim",
"Shopify.ruby-lsp",
"EditorConfig.EditorConfig",
"eamodio.gitlens"
],
"settings": {
"rubyLsp.rubyVersionManager": {
"identifier": "rvm"
},
"[ruby]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "Shopify.ruby-lsp"
}
}
}
},
"features": {
"ghcr.io/devcontainers/features/desktop-lite:1": {}
},
"forwardPorts": [
6080
],
"portsAttributes": {
"6080": {
"label": "playwright"
}
}
}
21 changes: 21 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
services:
app:
image: ghcr.io/nerdgeschoss/nerdgeschoss/development-environment:3.3-22
user: root
volumes:
- ../..:/workspaces:cached
- ~/.netrc:/root/.netrc
- ~/.ssh:/root/.ssh
- ~/.config/gh:/root/.config/gh
- ~/.cache/devcontainer/playwright:/root/.cache/devcontainer/playwright
- ~/.aws:/root/.aws
- /var/run/docker.sock:/var/run/docker.sock

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

environment:
TZ: Europe/Berlin
EDITOR: code --wait

working_dir: /workspace
10 changes: 3 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@ jobs:
strategy:
matrix:
ruby-version:
- "3.1"
- "3.2"
- "3.3"
gemfile:
- "rails-7-0"
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/Gemfile-${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies from apt
Expand All @@ -28,7 +23,7 @@ jobs:
bundler-cache: true
- uses: actions/setup-node@v4
with:
node-version: "18.x"
node-version: "22.x"
cache: "yarn"
- name: Install JS/TS Dependencies
run: yarn install
Expand All @@ -38,8 +33,9 @@ jobs:
run: yarn build
- name: Lint Ruby
run: bundle exec rubocop -c .rubocop.yml
- name: Install Playwright
run: npx -y playwright install --with-deps chromium
- name: Ruby Tests
run: (cd spec/rails_app && bin/rails assets:precompile) && bin/rspec --format documentation
env:
RAILS_ENV: test
RSPEC_RETRY_RETRY_COUNT: 3
3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
inherit_from: config/rubocop_base.yml

AllCops:
TargetRubyVersion: 3.1
TargetRubyVersion: 3.3
SuggestExtensions: false
Exclude:
- "bin/**/*"
- "spec/rails_app/bin/**/*"
Expand Down
25 changes: 10 additions & 15 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gemspec

gem "rails"
gem "propshaft"
gem "sqlite3", "~> 1.6"
gem "sqlite3"
gem "puma"
gem "jsbundling-rails"
gem "turbo-rails"
Expand All @@ -22,25 +22,20 @@ gem "dotenv-rails"
gem "image_processing"

group :development, :test do
gem "debug", platforms: [:mri, :mingw, :x64_mingw]
gem "debug", require: false
gem "rake"
gem "rspec-rails"
gem "rspec-retry"
gem "pry"
gem "pry-rails"
gem "pry-byebug"
gem "pry-doc"
gem "guard"
gem "guard-rspec"
gem "capybara"
gem "rack_session_access"
gem "cuprite"
gem "standard"
gem "rubocop"
gem "rubocop-rails"
gem "rubocop-performance"
gem "rubocop-rspec"
gem "rubocop-rake"
gem "capybara-playwright-driver"
gem "standard", require: false
gem "rubocop", require: false
gem "rubocop-rails", require: false
gem "rubocop-performance", require: false
gem "rubocop-rspec", require: false
gem "rubocop-rake", require: false
gem "ruby-lsp-rspec", require: false
end

group :development do
Expand Down
Loading