Skip to content
Open
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
89 changes: 89 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: "CI/CD"
on: [push]

env:
CI: "true"
CODECOV: "true"
RUBY_VERSION: 3.2.2
NODE_VERSION: 18.17.1
SHAKAPACKER_RUNTIME_COMPILE: "false"
RAILS_ENV: test
DISABLE_SPRING: "true"

jobs:
lint:
name: Lint code
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: rokroskar/workflow-run-cleanup-action@v0.3.0
if: "github.ref != 'refs/heads/develop'"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run Rubocop
run: bundle exec rubocop -P
tests:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:14
ports: [ "5432:5432" ]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_PASSWORD: postgres
env:
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: localhost
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: sudo apt install imagemagick
name: Install imagemagick
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "dir=$(npm get cache)-emitter" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: npm-cache
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-
- run: bundle exec rake test_app
name: Create test app
- run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots
name: Create the screenshots folder
- uses: nanasess/setup-chromedriver@v2
- run: RAILS_ENV=test bundle exec rails assets:precompile
name: Precompile assets
working-directory: ./spec/decidim_dummy_app/
- run: bundle exec rspec
name: RSpec
- uses: codecov/codecov-action@v3
- uses: actions/upload-artifact@v4
if: always()
with:
name: screenshots
path: ./spec/decidim_dummy_app/tmp/screenshots
if-no-files-found: ignore

2 changes: 1 addition & 1 deletion .rubocop_ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ AllCops:
# If a value is specified for TargetRubyVersion then it is used.
# Else if .ruby-version exists and it contains an MRI version it is used.
# Otherwise we fallback to the oldest officially supported Ruby version (2.0).
TargetRubyVersion: 3.0
TargetRubyVersion: 3.2

RSpec:
Patterns:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.2
3.2.2
17 changes: 8 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,26 @@ source "https://rubygems.org"

ruby RUBY_VERSION

gem "decidim", "~> 0.27"
gem "decidim-core"

gem "graphql", "1.12.24"
gem "graphql-docs", "2.1.0"
gem "decidim", "~> 0.29.3"
gem "decidim-core", "~> 0.29.3"

gem "graphql", "~> 2.0"
gem "graphql-docs", "~> 4.0"

gem "decidim-admin_multi_factor", path: "./"

gem "bootsnap", "~> 1.3"

group :development, :test do
gem "decidim-dev"
gem "decidim-dev", "~> 0.29.3"
end

group :development do
gem "letter_opener_web", "~> 1.4"
gem "letter_opener_web", "~> 2.0"
gem "listen", "~> 3.1"
gem "spring", "~> 2.0"
gem "spring", "~> 4.0"
gem "spring-watcher-listen", "~> 2.0"
gem "web-console", "~> 4.0"
gem "web-console", "~> 4.2"
end

group :test do
Expand Down
Loading