Skip to content

Commit

Permalink
Merge branch 'CircuitVerse:master' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
gitsofaryan authored Jan 11, 2025
2 parents 3e370ec + 6b6b4e0 commit 796eac0
Show file tree
Hide file tree
Showing 99 changed files with 3,059 additions and 4,093 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ FROM ruby:3.2.1-slim
RUN apt-get update -qq && apt-get install -y build-essential ca-certificates curl gnupg imagemagick shared-mime-info cmake cmake-data netcat libvips libpq-dev pkg-config git \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update && apt-get install -y nodejs && apt-get autoremove && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/* \
&& npm install -g yarn
&& npm install -g yarn
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Exclude minified JavaScript files
public/js/**/*.min.js

# Exclude third-party libraries
public/js/plugins/**/*.js
8 changes: 6 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ jobs:
matrix:
language: [ 'javascript', 'ruby' ]


steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand All @@ -39,4 +43,4 @@ jobs:
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
category: "/language:${{matrix.language}}"
22 changes: 15 additions & 7 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
name: Docker publish

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
schedule:
- cron: '26 5 * * *'
Expand Down Expand Up @@ -35,13 +30,26 @@ jobs:
submodules: recursive

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '18'
cache: 'yarn' # Added caching for faster builds

- name: Copy sample database configuration
run: cp config/database.example.yml config/database.yml

# Fix: Added dependency installations to address apt-get failures
- name: Install required dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
software-properties-common \
gnupg \
build-essential
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: jsdocs-dep
run: npm install

- name: jsdocs-generate
run: node ./node_modules/jsdoc/jsdoc.js ./simulator/src -r -c ./conf.json -t ./node_modules/better-docs -d ./out

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
cname: simulator-docs.circuitverse.org
cname: simulator-docs.circuitverse.org
10 changes: 5 additions & 5 deletions .github/workflows/jest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Simulator Testing

on:
push:
branches: [master]
Expand All @@ -9,29 +10,28 @@ on:
- "esbuild.config.js"
- "jest.config.js"
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
paths:
- "simulator/**"
- "package.json"
- "yarn.lock"
- "esbuild.config.js"
- "jest.config.js"

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
node-version: '18'
cache: 'yarn'

# Install required deps for action
- name: Install Dependencies
run: yarn

# Finally, run our tests
- name: Run the tests
run: yarn test
run: yarn test
40 changes: 32 additions & 8 deletions .github/workflows/rubyonrails.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: "Ruby on Rails CI"

on:
[push, pull_request, workflow_dispatch]

jobs:
test:
permissions:
Expand Down Expand Up @@ -29,31 +31,47 @@ jobs:
with:
fetch-depth: 100
submodules: recursive

- name: Install Ruby and gems
uses: ruby/setup-ruby@v1 # v1.115.3
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- uses: actions/setup-node@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
node-version: '18'
cache: 'yarn'

- name: Install Dependencies for canvas
run: |
sudo apt-get update
sudo apt-get install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++
- name: Install reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- run: yarn install --frozen-lockfile --immutable

- run: yarn install --frozen-lockfile --immutable

- name: Copy the sample ENV Config
run: cp .env.example .env

- name: Set up database schema
run: bin/rails db:schema:load

- name: Run data migration tasks
run: bin/rails data:migrate

- name: Build assets
run: yarn run build

- name: Configure keys
run: |
openssl genrsa -out config/private.pem 2048
openssl rsa -in config/private.pem -outform PEM -pubout -out config/public.pem
- name: Run tests
run: bundle exec rspec

Expand All @@ -70,28 +88,34 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
bodyContains: "[undercover]"
noReply: "true"

- name: Run reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.github_token }}
run: |
git fetch --no-tags
reviewdog -reporter=github-pr-review -runners=undercover --fail-on-error
- name: Static type checking
run: |
run: |
bundle exec rbs collection install
bundle exec steep check
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Ruby and gems
uses: ruby/setup-ruby@v1 # v1.115.3
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Security audit dependencies
run: bundle exec bundler-audit --update
run: bundle exec bundler-audit --update

- name: Lint Ruby files
run: bundle exec rubocop --parallel
run: bundle exec rubocop --parallel
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
10 changes: 6 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ gem "omniauth-microsoft-office365"
gem 'omniauth-rails_csrf_protection'
gem "view_component"
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "rails", "~> 7.0"
gem "rails", "~> 7.0.8.7"
# Use Puma as the app server
gem "puma", "~> 6.4"
# Use SCSS for stylesheets
Expand Down Expand Up @@ -62,7 +62,7 @@ gem "sidekiq"
gem "sunspot_rails"

# For home page pagination
gem "will_paginate", "~> 3.3.1"
gem "will_paginate", "~> 4.0.1"
gem "will_paginate-bootstrap"

gem "country_select", "~> 8.0"
Expand Down Expand Up @@ -99,7 +99,7 @@ gem "meta-tags"
gem "webpush"

gem "bootsnap", require: false
gem "rexml"
gem 'rexml', '>= 3.3.9'

gem "font-awesome-sass", "~> 5.13.1"

Expand Down Expand Up @@ -189,7 +189,7 @@ gem "stimulus-rails", "~> 1.0"
gem "noticed", "~> 1.6"

# ActiveStorage AWS S3 + Variant Processing
gem "aws-sdk-s3", "~> 1.116"
gem "aws-sdk-s3", "~> 1.176"
gem "image_processing", "~> 1.12"
# Distributed Tracing OTEL ruby
gem "opentelemetry-sdk", "~> 1.2"
Expand Down Expand Up @@ -221,3 +221,5 @@ gem "sentry-sidekiq", "~> 5.17"

# for SAML based SSO
gem 'devise_saml_authenticatable'

gem 'activerecord_cursor_paginate'
Loading

0 comments on commit 796eac0

Please sign in to comment.