Skip to content

Commit

Permalink
General update of the application dependencies
Browse files Browse the repository at this point in the history
* Remove spring and guard
* Remove form generator
* Switch to GHA from CircleCI
* Upgrade to Ruby 3.2
* Configure dependabot
  • Loading branch information
pixeltrix committed Nov 6, 2024
1 parent 466eea2 commit cf7d6ca
Show file tree
Hide file tree
Showing 42 changed files with 2,809 additions and 2,339 deletions.
91 changes: 0 additions & 91 deletions .circleci/config.yml

This file was deleted.

11 changes: 4 additions & 7 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
node_modules
log
tmp
.dockerignore
docker-compose.yml
Dockerfile
public/packs
/log/*
/tmp/*
/node_modules/*
/public/packs/*
42 changes: 42 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: 2
updates:
- package-ecosystem: bundler
ignore:
- dependency-name: "rails"
update-types: ["version-update:semver-minor"]
- dependency-name: "*"
update-types: ["version-update:semver-major"]
directory: /
schedule:
interval: daily
versioning-strategy: increase-if-necessary
open-pull-requests-limit: 10
groups:
rails:
applies-to: version-updates
patterns:
- "action*"
- "active*"
- "rails"
- "railties"
update-types:
- "patch"

- package-ecosystem: npm
directory: /
schedule:
interval: daily
versioning-strategy: increase-if-necessary

# Ruby needs to be upgraded manually in multiple places, so cannot be upgraded by Dependabot.
- package-ecosystem: docker
ignore:
- dependency-name: ruby
directory: /
schedule:
interval: weekly

- package-ecosystem: "github-actions"
directory: /
schedule:
interval: daily
185 changes: 185 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
name: Build

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
bundle-audit:
runs-on: ubuntu-20.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 16
cache: "yarn"

- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true

- name: Check bundle for known CVEs
run: |
bundle exec bundle-audit check --update
brakeman:
runs-on: ubuntu-20.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 16
cache: "yarn"

- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true

- name: Analyse code for vulnerabilities
run: |
bundle exec brakeman --no-pager
rubocop:
runs-on: ubuntu-20.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 16
cache: "yarn"

- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true

- name: Lint source code with rubocop
run: |
bundle exec rubocop
rspec:
runs-on: ubuntu-20.04

services:
postgres:
image: postgres:16
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 16
cache: "yarn"

- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true

- name: Setup test database
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test
RAILS_ENV: test
run: |
bundle exec rake db:create db:schema:load
- name: Compile assets
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test
RAILS_ENV: test
run: |
bundle exec rake assets:precompile
- name: Run rspec specs
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test
NOTIFY_API_KEY: ${{ secrets.NOTIFY_API_KEY }}
NOTIFY_CALLBACK_TOKEN: ${{ secrets.NOTIFY_CALLBACK_TOKEN }}
RAILS_ENV: test
run: |
bundle exec rspec
cucumber:
runs-on: ubuntu-20.04

services:
postgres:
image: postgres:16
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 16
cache: "yarn"

- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true

- name: Setup test database
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test
RAILS_ENV: test
run: |
bundle exec rake db:create db:schema:load
- name: Compile assets
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test
RAILS_ENV: test
run: |
bundle exec rake assets:precompile
- name: Run cucumber specs
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test
RAILS_ENV: test
NOTIFY_API_KEY: ${{ secrets.NOTIFY_API_KEY }}
NOTIFY_CALLBACK_TOKEN: ${{ secrets.NOTIFY_CALLBACK_TOKEN }}
run: |
bundle exec cucumber
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,5 @@ yarn-debug.log*
# Ignore rspec failures log
rspec_failures.txt

#ignore mac ds files
.DS_Store

#ignore .env files
.env*.local
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.5
3.2.6
Loading

0 comments on commit cf7d6ca

Please sign in to comment.