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

Bump/osp pr #8

Open
wants to merge 48 commits into
base: release/0.28-stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
ed778bf
feat: update gemfile.lock
Stef-Rousset Jan 20, 2025
bf89bfd
feat: modify packs directory
Stef-Rousset Jan 20, 2025
93c27b1
feat: add assets file in config
Stef-Rousset Jan 20, 2025
4820533
feat: update commands
Stef-Rousset Jan 20, 2025
5d32a7f
test: update commands tests
Stef-Rousset Jan 20, 2025
5005bc8
feat: update admin controller and add new controller
Stef-Rousset Jan 20, 2025
bfc8438
feat: update model
Stef-Rousset Jan 20, 2025
78a5eab
feat: update forms
Stef-Rousset Jan 20, 2025
152e83e
test: update form tests
Stef-Rousset Jan 20, 2025
85b1ee5
feat: update views and add 2 new views files
Stef-Rousset Jan 20, 2025
0b00fd5
feat: update engine
Stef-Rousset Jan 20, 2025
28fbb32
feat: udpate deface file
Stef-Rousset Jan 20, 2025
a9d32b5
feat: update serializer
Stef-Rousset Jan 20, 2025
553f2d5
test: update serializer test
Stef-Rousset Jan 20, 2025
4a170da
feat: add mailer
Stef-Rousset Jan 20, 2025
ed3ce42
feat: add job
Stef-Rousset Jan 20, 2025
199054a
test: add test for job
Stef-Rousset Jan 20, 2025
c10698f
feat: update spec helper file
Stef-Rousset Jan 20, 2025
ceb4c9f
test: updat system tests
Stef-Rousset Jan 20, 2025
59bbdb8
feat: update locales files and add new de file
Stef-Rousset Jan 20, 2025
a641978
fix: update i18n task file
Stef-Rousset Jan 20, 2025
dbbfd39
style: update files with rubocop
Stef-Rousset Jan 20, 2025
bd7352a
test: update accont system test
Stef-Rousset Jan 21, 2025
b122ecd
ci: update actions in ci
Stef-Rousset Jan 21, 2025
0486481
fix: add options to selenium driver
Stef-Rousset Jan 21, 2025
145f7bb
ci: add chrome version and dependencies
Stef-Rousset Jan 21, 2025
418ef9b
ci: add new package
Stef-Rousset Jan 21, 2025
662a1ca
fix: add new options to selenium driver
Stef-Rousset Jan 21, 2025
ebc783d
ci: add chrome-driver version
Stef-Rousset Jan 21, 2025
845ae9d
ci: try updating ci again to fix error
Stef-Rousset Jan 21, 2025
fe9f22b
fix: add option to webdriver and update ci
Stef-Rousset Jan 21, 2025
3e40d1e
fix: update gemfile to fix CreateList error
Stef-Rousset Jan 21, 2025
0d9eb6a
style: use double quotes in gemfile
Stef-Rousset Jan 21, 2025
3265e16
style: update rubocop.yml file
Stef-Rousset Jan 22, 2025
106618d
fix: update options for selenium webdriver
Stef-Rousset Jan 22, 2025
bcb7e29
style: update spec file and rubocop.yml file
Stef-Rousset Jan 22, 2025
77fb778
ci: update ci file to try fixing error
Stef-Rousset Jan 22, 2025
08a5094
ci: update in ci file
Stef-Rousset Jan 22, 2025
e117172
ci: another update of ci file
Stef-Rousset Jan 22, 2025
e84f1de
test: another update of options for webdriver
Stef-Rousset Jan 22, 2025
d3b563a
ci: add specific chrome version again
Stef-Rousset Jan 22, 2025
215cf4e
ci: update again
Stef-Rousset Jan 22, 2025
962b0fc
test: remove webdriver options
Stef-Rousset Jan 22, 2025
fbea2e0
ci:implement ci similar to decidim/decidim
Stef-Rousset Jan 22, 2025
e6e9501
ci: update ci
Stef-Rousset Jan 22, 2025
d2ff8a2
fix: add package-lock.json
Stef-Rousset Jan 22, 2025
2d3cd3a
ci: fix test.yml
Stef-Rousset Jan 22, 2025
f634c0b
ci: fix in test.yml
Stef-Rousset Jan 22, 2025
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
66 changes: 66 additions & 0 deletions .github/workflows/build_app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
on:
workflow_call:
inputs:
ruby_version:
description: 'Ruby Version'
default: "3.1.1"
type: string
required: false
node_version:
description: 'Node version'
default: '18.17.1'
required: false
type: string
jobs:
build_app:
name: Build app
runs-on: ubuntu-22.04
if: "!startsWith(github.head_ref, 'chore/l10n')"
timeout-minutes: 60
env:
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: localhost
RUBYOPT: '-W:no-deprecated'
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
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ inputs.ruby_version }}
bundler-cache: true
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node_version }}
cache: 'npm'
cache-dependency-path: ./package-lock.json
- uses: actions/cache@v3
id: app-cache
with:
path: ./spec/decidim_dummy_app/
key: app-${{ github.sha }}
restore-keys: app-${{ github.sha }}
- run: bundle exec rake test_app
name: Create test app
shell: "bash"
- run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots
name: Create the screenshots folder
shell: "bash"
- run: RAILS_ENV=test bundle exec rails assets:precompile
name: Precompile assets
working-directory: ./spec/decidim_dummy_app/
shell: "bash"
env:
NODE_ENV: "test"
150 changes: 30 additions & 120 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
name: "[CI] ExtraUserFields"
on: "push"
on:
push:
branches:
- develop
- release/*
- "*-stable"
pull_request:
branches-ignore:
- "chore/l10n*"
paths:
- "*"
- ".github/**"

env:
CI: "true"
RUBY_VERSION: 3.1.1
NODE_VERSION: 18.17.1

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
build_app:
uses: ./.github/workflows/build_app.yml
secrets: inherit
name: Build test application

lint:
name: Lint code
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-node@master
Expand All @@ -24,123 +46,11 @@ jobs:
name: Lint Ruby files
- run: bundle exec erblint app/**/*.erb
name: Lint ERB files

tests:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:11
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: rokroskar/[email protected]
if: "github.ref != 'refs/heads/develop'"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/[email protected]
with:
fetch-depth: 1
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm get cache)-extra_user_fields"
- uses: actions/cache@v2
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 --exclude-pattern "spec/system/**/*_spec.rb"
name: RSpec
- uses: codecov/codecov-action@v1
- uses: actions/upload-artifact@v2
if: always()
with:
name: screenshots
path: ./spec/decidim_dummy_app/tmp/screenshots
if-no-files-found: ignore
system-tests:
name: System tests
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:11
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: rokroskar/[email protected]
if: "github.ref != 'refs/heads/develop'"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/[email protected]
with:
fetch-depth: 1
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm get cache)-extra_user_fields"
- uses: actions/cache@v2
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 spec/system
name: RSpec
- uses: codecov/codecov-action@v1
- uses: actions/upload-artifact@v2
if: always()
with:
name: screenshots
path: ./spec/decidim_dummy_app/tmp/screenshots
if-no-files-found: ignore
needs: build_app
uses: ./.github/workflows/test_app.yml
with:
test_command: "bundle exec rspec --pattern './spec/**/*_spec.rb'"
secrets: inherit
97 changes: 97 additions & 0 deletions .github/workflows/test_app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
on:
workflow_call:
inputs:
ruby_version:
description: 'Ruby Version'
default: "3.1.1"
required: false
type: string
test_command:
description: 'The testing command to be ran'
required: true
type: string
chrome_version:
description: 'Chrome & Chromedriver version'
required: false
default: "126.0.6478.182"
type: string

jobs:
build_app:
name: Test app
runs-on: ubuntu-22.04
if: "!startsWith(github.head_ref, 'chore/l10n')"
timeout-minutes: 60
env:
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: localhost
RUBYOPT: '-W:no-deprecated'
services:
validator:
image: ghcr.io/validator/validator:latest
ports: ["8888:8888"]
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
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ inputs.ruby_version }}
bundler-cache: true
- run: |
sudo apt update
sudo apt install libu2f-udev
wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${{inputs.chrome_version}}-1_amd64.deb
sudo dpkg -i /tmp/chrome.deb
rm /tmp/chrome.deb
- uses: nanasess/setup-chromedriver@v2
name: Install Chrome version ${{inputs.chrome_version}}
with:
chromedriver-version: ${{inputs.chrome_version}}
- uses: actions/cache@v3
id: app-cache
with:
path: ./spec/decidim_dummy_app/
key: app-${{ github.sha }}
restore-keys: app-${{ github.sha }}
- run: bundle exec rails db:create db:schema:load
name: Install gems and create db
shell: "bash"
working-directory: ./spec/decidim_dummy_app/
- run: |
sudo Xvfb -ac $DISPLAY -screen 0 1920x1084x24 > /dev/null 2>&1 &
${{ inputs.test_command }}
name: RSpec
working-directory: ./
env:
VALIDATOR_HTML_URI: http://localhost:8888/
RUBY_VERSION: ${{ inputs.ruby_version }}
DECIDIM_MODULE: ${{ inputs.working-directory }}
DISPLAY: ":99"
CI: "true"
SIMPLECOV: "true"
SHAKAPACKER_RUNTIME_COMPILE: "false"
NODE_ENV: "test"
- uses: codecov/codecov-action@v3
name: Upload coverage
with:
name: ${{ inputs.working-directory }}
flags: ${{ inputs.working-directory }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: screenshots
path: ./spec/decidim_dummy_app/tmp/screenshots
if-no-files-found: ignore
overwrite: true
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ gem "puma", ">= 4.3"

group :development, :test do
gem "byebug", "~> 11.0", platform: :mri

gem "decidim-dev", DECIDIM_VERSION
end

Expand All @@ -28,3 +27,8 @@ group :development do
gem "spring-watcher-listen", "~> 2.0"
gem "web-console", "~> 3.5"
end

group :test do
gem "rubocop-factory_bot", "!= 2.26.0", require: false
gem "rubocop-rspec_rails", "!= 2.29.0", require: false
end
9 changes: 7 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ GEM
net-smtp (0.3.4)
net-protocol
nio4r (2.7.3)
nokogiri (1.16.6-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.6-x86_64-linux)
racc (~> 1.4)
oauth (1.1.0)
Expand Down Expand Up @@ -669,7 +671,7 @@ GEM
parser (>= 3.3.1.0)
rubocop-capybara (2.21.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.26.0)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-faker (1.1.0)
faker (>= 2.12.0)
Expand All @@ -684,7 +686,7 @@ GEM
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
rubocop-rspec_rails (~> 2.28)
rubocop-rspec_rails (2.29.0)
rubocop-rspec_rails (2.28.3)
rubocop (~> 1.40)
ruby-progressbar (1.13.0)
ruby-vips (2.2.1)
Expand Down Expand Up @@ -794,6 +796,7 @@ GEM
zeitwerk (2.6.16)

PLATFORMS
x86_64-darwin-24
x86_64-linux

DEPENDENCIES
Expand All @@ -807,7 +810,9 @@ DEPENDENCIES
letter_opener_web (~> 1.3)
listen (~> 3.1)
puma (>= 4.3)
rubocop-factory_bot (!= 2.26.0)
rubocop-faker
rubocop-rspec_rails (!= 2.29.0)
spring (~> 2.0)
spring-watcher-listen (~> 2.0)
web-console (~> 3.5)
Expand Down
Loading
Loading