kosiakkatrina
6 days ago
committed by
GitHub
208 changed files with 2249 additions and 3172 deletions
@ -0,0 +1,411 @@
|
||||
name: Run Tests |
||||
|
||||
on: |
||||
workflow_call: |
||||
pull_request: |
||||
types: |
||||
- opened |
||||
- synchronize |
||||
merge_group: |
||||
workflow_dispatch: |
||||
|
||||
defaults: |
||||
run: |
||||
shell: bash |
||||
|
||||
jobs: |
||||
test: |
||||
name: Tests |
||||
runs-on: ubuntu-latest |
||||
|
||||
services: |
||||
postgres: |
||||
image: postgres:13.18 |
||||
env: |
||||
POSTGRES_PASSWORD: password |
||||
POSTGRES_USER: postgres |
||||
POSTGRES_DB: data_collector |
||||
ports: |
||||
- 5432:5432 |
||||
# Needed because the Postgres container does not provide a health check |
||||
# tmpfs makes database faster by using RAM |
||||
options: >- |
||||
--mount type=tmpfs,destination=/var/lib/postgresql/data |
||||
--health-cmd pg_isready |
||||
--health-interval 10s |
||||
--health-timeout 5s |
||||
--health-retries 5 |
||||
|
||||
env: |
||||
RAILS_ENV: test |
||||
GEMFILE_RUBY_VERSION: 3.1.1 |
||||
DB_HOST: localhost |
||||
DB_DATABASE: data_collector |
||||
DB_USERNAME: postgres |
||||
DB_PASSWORD: password |
||||
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} |
||||
PARALLEL_TEST_PROCESSORS: 4 |
||||
|
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v4 |
||||
|
||||
- name: Set up Ruby |
||||
uses: ruby/setup-ruby@v1 |
||||
with: |
||||
bundler-cache: true |
||||
|
||||
- name: Set up Node.js |
||||
uses: actions/setup-node@v4 |
||||
with: |
||||
cache: yarn |
||||
node-version: 20 |
||||
|
||||
- name: Create database |
||||
run: | |
||||
bundle exec rake parallel:setup |
||||
|
||||
- name: Compile assets |
||||
run: | |
||||
bundle exec rake assets:precompile |
||||
|
||||
- name: Run tests |
||||
run: | |
||||
bundle exec rake parallel:spec['spec\/(?!features|models|requests|services)'] |
||||
|
||||
feature_test: |
||||
name: Feature Tests |
||||
runs-on: ubuntu-latest |
||||
|
||||
services: |
||||
postgres: |
||||
image: postgres:13.18 |
||||
env: |
||||
POSTGRES_PASSWORD: password |
||||
POSTGRES_USER: postgres |
||||
POSTGRES_DB: data_collector |
||||
ports: |
||||
- 5432:5432 |
||||
# Needed because the Postgres container does not provide a health check |
||||
# tmpfs makes database faster by using RAM |
||||
options: >- |
||||
--mount type=tmpfs,destination=/var/lib/postgresql/data |
||||
--health-cmd pg_isready |
||||
--health-interval 10s |
||||
--health-timeout 5s |
||||
--health-retries 5 |
||||
|
||||
env: |
||||
RAILS_ENV: test |
||||
GEMFILE_RUBY_VERSION: 3.1.1 |
||||
DB_HOST: localhost |
||||
DB_DATABASE: data_collector |
||||
DB_USERNAME: postgres |
||||
DB_PASSWORD: password |
||||
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} |
||||
|
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v4 |
||||
|
||||
- name: Set up Ruby |
||||
uses: ruby/setup-ruby@v1 |
||||
with: |
||||
bundler-cache: true |
||||
|
||||
- name: Set up Node.js |
||||
uses: actions/setup-node@v4 |
||||
with: |
||||
cache: yarn |
||||
node-version: 20 |
||||
|
||||
- name: Create database |
||||
run: | |
||||
bundle exec rake db:prepare |
||||
|
||||
- name: Compile assets |
||||
run: | |
||||
bundle exec rake assets:precompile |
||||
|
||||
- name: Run tests |
||||
run: | |
||||
bundle exec rspec spec/features --fail-fast --exclude-pattern "spec/features/accessibility_spec.rb" |
||||
|
||||
model_test: |
||||
name: Model tests |
||||
runs-on: ubuntu-latest |
||||
|
||||
services: |
||||
postgres: |
||||
image: postgres:13.18 |
||||
env: |
||||
POSTGRES_PASSWORD: password |
||||
POSTGRES_USER: postgres |
||||
POSTGRES_DB: data_collector |
||||
ports: |
||||
- 5432:5432 |
||||
# Needed because the Postgres container does not provide a health check |
||||
# tmpfs makes database faster by using RAM |
||||
options: >- |
||||
--mount type=tmpfs,destination=/var/lib/postgresql/data |
||||
--health-cmd pg_isready |
||||
--health-interval 10s |
||||
--health-timeout 5s |
||||
--health-retries 5 |
||||
|
||||
env: |
||||
RAILS_ENV: test |
||||
GEMFILE_RUBY_VERSION: 3.1.1 |
||||
DB_HOST: localhost |
||||
DB_DATABASE: data_collector |
||||
DB_USERNAME: postgres |
||||
DB_PASSWORD: password |
||||
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} |
||||
|
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v4 |
||||
|
||||
- name: Set up Ruby |
||||
uses: ruby/setup-ruby@v1 |
||||
with: |
||||
bundler-cache: true |
||||
|
||||
- name: Set up Node.js |
||||
uses: actions/setup-node@v4 |
||||
with: |
||||
cache: yarn |
||||
node-version: 20 |
||||
|
||||
- name: Create database |
||||
run: | |
||||
bundle exec rake db:prepare |
||||
|
||||
- name: Compile assets |
||||
run: | |
||||
bundle exec rake assets:precompile |
||||
|
||||
- name: Run tests |
||||
run: | |
||||
bundle exec rspec spec/models --fail-fast |
||||
|
||||
requests_test: |
||||
name: Requests tests |
||||
runs-on: ubuntu-latest |
||||
|
||||
services: |
||||
postgres: |
||||
image: postgres:13.18 |
||||
env: |
||||
POSTGRES_PASSWORD: password |
||||
POSTGRES_USER: postgres |
||||
POSTGRES_DB: data_collector |
||||
ports: |
||||
- 5432:5432 |
||||
# Needed because the Postgres container does not provide a health check |
||||
# tmpfs makes database faster by using RAM |
||||
options: >- |
||||
--mount type=tmpfs,destination=/var/lib/postgresql/data |
||||
--health-cmd pg_isready |
||||
--health-interval 10s |
||||
--health-timeout 5s |
||||
--health-retries 5 |
||||
|
||||
env: |
||||
RAILS_ENV: test |
||||
GEMFILE_RUBY_VERSION: 3.1.1 |
||||
DB_HOST: localhost |
||||
DB_DATABASE: data_collector |
||||
DB_USERNAME: postgres |
||||
DB_PASSWORD: password |
||||
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} |
||||
PARALLEL_TEST_PROCESSORS: 4 |
||||
|
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v4 |
||||
|
||||
- name: Set up Ruby |
||||
uses: ruby/setup-ruby@v1 |
||||
with: |
||||
bundler-cache: true |
||||
|
||||
- name: Set up Node.js |
||||
uses: actions/setup-node@v4 |
||||
with: |
||||
cache: yarn |
||||
node-version: 20 |
||||
|
||||
- name: Create database |
||||
run: | |
||||
bundle exec rake parallel:setup |
||||
|
||||
- name: Compile assets |
||||
run: | |
||||
bundle exec rake assets:precompile |
||||
|
||||
- name: Run tests |
||||
run: | |
||||
bundle exec rake parallel:spec['spec/requests'] |
||||
|
||||
services_test: |
||||
name: Services Tests |
||||
runs-on: ubuntu-latest |
||||
|
||||
services: |
||||
postgres: |
||||
image: postgres:13.18 |
||||
env: |
||||
POSTGRES_PASSWORD: password |
||||
POSTGRES_USER: postgres |
||||
POSTGRES_DB: data_collector |
||||
ports: |
||||
- 5432:5432 |
||||
# Needed because the Postgres container does not provide a health check |
||||
# tmpfs makes database faster by using RAM |
||||
options: >- |
||||
--mount type=tmpfs,destination=/var/lib/postgresql/data |
||||
--health-cmd pg_isready |
||||
--health-interval 10s |
||||
--health-timeout 5s |
||||
--health-retries 5 |
||||
|
||||
env: |
||||
RAILS_ENV: test |
||||
GEMFILE_RUBY_VERSION: 3.1.1 |
||||
DB_HOST: localhost |
||||
DB_DATABASE: data_collector |
||||
DB_USERNAME: postgres |
||||
DB_PASSWORD: password |
||||
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} |
||||
PARALLEL_TEST_PROCESSORS: 4 |
||||
|
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v4 |
||||
|
||||
- name: Set up Ruby |
||||
uses: ruby/setup-ruby@v1 |
||||
with: |
||||
bundler-cache: true |
||||
|
||||
- name: Set up Node.js |
||||
uses: actions/setup-node@v4 |
||||
with: |
||||
cache: yarn |
||||
node-version: 20 |
||||
|
||||
- name: Create database |
||||
run: | |
||||
bundle exec rake parallel:setup |
||||
|
||||
- name: Compile assets |
||||
run: | |
||||
bundle exec rake assets:precompile |
||||
|
||||
- name: Run tests |
||||
run: | |
||||
bundle exec rake parallel:spec['spec\/services'] |
||||
|
||||
accessibility_test: |
||||
name: Accessibility tests |
||||
runs-on: ubuntu-latest |
||||
|
||||
services: |
||||
postgres: |
||||
image: postgres:13.18 |
||||
env: |
||||
POSTGRES_PASSWORD: password |
||||
POSTGRES_USER: postgres |
||||
POSTGRES_DB: data_collector |
||||
ports: |
||||
- 5432:5432 |
||||
# Needed because the Postgres container does not provide a health check |
||||
# tmpfs makes database faster by using RAM |
||||
options: >- |
||||
--mount type=tmpfs,destination=/var/lib/postgresql/data |
||||
--health-cmd pg_isready |
||||
--health-interval 10s |
||||
--health-timeout 5s |
||||
--health-retries 5 |
||||
|
||||
env: |
||||
RAILS_ENV: test |
||||
GEMFILE_RUBY_VERSION: 3.1.1 |
||||
DB_HOST: localhost |
||||
DB_DATABASE: data_collector |
||||
DB_USERNAME: postgres |
||||
DB_PASSWORD: password |
||||
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} |
||||
PARALLEL_TEST_PROCESSORS: 4 |
||||
|
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v4 |
||||
|
||||
- name: Set up Ruby |
||||
uses: ruby/setup-ruby@v1 |
||||
with: |
||||
bundler-cache: true |
||||
|
||||
- name: Set up Node.js |
||||
uses: actions/setup-node@v4 |
||||
with: |
||||
cache: yarn |
||||
node-version: 20 |
||||
|
||||
- name: Create database |
||||
run: | |
||||
bundle exec rake parallel:setup |
||||
|
||||
- name: Compile assets |
||||
run: | |
||||
bundle exec rake assets:precompile |
||||
|
||||
- name: Run tests |
||||
run: | |
||||
bundle exec rspec spec/features/accessibility_spec.rb --fail-fast |
||||
|
||||
lint: |
||||
name: Lint |
||||
runs-on: ubuntu-latest |
||||
|
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v4 |
||||
|
||||
- name: Set up Ruby |
||||
uses: ruby/setup-ruby@v1 |
||||
with: |
||||
bundler-cache: true |
||||
|
||||
- name: Set up Node.js |
||||
uses: actions/setup-node@v4 |
||||
with: |
||||
cache: yarn |
||||
node-version: 20 |
||||
|
||||
- name: Install packages and symlink local dependencies |
||||
run: | |
||||
yarn install --immutable --immutable-cache --check-cache |
||||
|
||||
- name: Lint |
||||
run: | |
||||
bundle exec rake lint |
||||
|
||||
audit: |
||||
name: Audit dependencies |
||||
runs-on: ubuntu-latest |
||||
|
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v4 |
||||
|
||||
- name: Set up Ruby |
||||
uses: ruby/setup-ruby@v1 |
||||
with: |
||||
bundler-cache: true |
||||
|
||||
- name: Audit |
||||
run: | |
||||
bundle exec bundler-audit |
@ -1,17 +1,5 @@
|
||||
<nav class="app-primary-navigation" aria-label="primary"> |
||||
<div class="govuk-width-container"> |
||||
<ul class="app-primary-navigation__list"> |
||||
<% items.each do |item| %> |
||||
<% if item.current %> |
||||
<li class="app-primary-navigation__item app-primary-navigation__item--current"> |
||||
<%= govuk_link_to item[:text], item[:href], class: "app-primary-navigation__link", aria: { current: "page" } %> |
||||
</li> |
||||
<% else %> |
||||
<li class="app-primary-navigation__item"> |
||||
<%= govuk_link_to item[:text], item[:href], class: "app-primary-navigation__link" %> |
||||
</li> |
||||
<% end %> |
||||
<% end %> |
||||
</ul> |
||||
</div> |
||||
</nav> |
||||
<%= govuk_service_navigation(navigation_id: "primary-navigation", classes: "app-service-navigation") do |sn| |
||||
items.each do |item| |
||||
sn.with_navigation_item(text: item[:text], href: item[:href], classes: "", current: item[:current]) |
||||
end |
||||
end %> |
||||
|
@ -1,69 +0,0 @@
|
||||
.app-primary-navigation { |
||||
@include govuk-font(19, $weight: bold); |
||||
background-color: govuk-colour("light-grey"); |
||||
border-bottom: 1px solid $govuk-border-colour; |
||||
} |
||||
|
||||
.govuk-phase-banner + .app-primary-navigation { |
||||
margin-top: -1px; |
||||
} |
||||
|
||||
.app-primary-navigation__list { |
||||
@include govuk-clearfix; |
||||
left: govuk-spacing(-3); |
||||
list-style: none; |
||||
margin: 0; |
||||
padding: 0; |
||||
position: relative; |
||||
right: govuk-spacing(-3); |
||||
width: calc(100% + #{govuk-spacing(6)}); |
||||
} |
||||
|
||||
.app-primary-navigation__item { |
||||
box-sizing: border-box; |
||||
display: block; |
||||
float: left; |
||||
line-height: 50px; |
||||
height: 50px; |
||||
padding: 0 govuk-spacing(3); |
||||
position: relative; |
||||
} |
||||
|
||||
.app-primary-navigation__item--current { |
||||
border-bottom: $govuk-border-width-narrow solid $govuk-link-colour; |
||||
|
||||
&:hover { |
||||
border-bottom-color: $govuk-link-hover-colour; |
||||
} |
||||
|
||||
&:active { |
||||
border-bottom-color: $govuk-link-active-colour; |
||||
} |
||||
} |
||||
|
||||
.app-primary-navigation__item--align-right { |
||||
@include govuk-media-query($from: tablet) { |
||||
float: right; |
||||
} |
||||
} |
||||
|
||||
.app-primary-navigation__link { |
||||
@include govuk-link-common; |
||||
@include govuk-link-style-no-visited-state; |
||||
@include govuk-link-style-no-underline; |
||||
@include govuk-typography-weight-bold; |
||||
|
||||
// Extend the touch area of the link to the list |
||||
&::after { |
||||
bottom: 0; |
||||
content: ""; |
||||
left: 0; |
||||
position: absolute; |
||||
right: 0; |
||||
top: 0; |
||||
} |
||||
} |
||||
|
||||
.app-primary-navigation__item--current .app-primary-navigation__link:hover { |
||||
text-decoration: none; |
||||
} |
@ -1,39 +0,0 @@
|
||||
module Forms |
||||
module BulkUploadLettings |
||||
class Needstype |
||||
include ActiveModel::Model |
||||
include ActiveModel::Attributes |
||||
include Rails.application.routes.url_helpers |
||||
|
||||
attribute :needstype, :integer |
||||
attribute :year, :integer |
||||
attribute :organisation_id, :integer |
||||
|
||||
validates :needstype, presence: true |
||||
|
||||
def view_path |
||||
"bulk_upload_lettings_logs/forms/needstype" |
||||
end |
||||
|
||||
def options |
||||
[OpenStruct.new(id: 1, name: "General needs"), OpenStruct.new(id: 2, name: "Supported housing")] |
||||
end |
||||
|
||||
def back_path |
||||
bulk_upload_lettings_log_path(id: "prepare-your-file", form: { year:, needstype:, organisation_id: }.compact) |
||||
end |
||||
|
||||
def next_path |
||||
bulk_upload_lettings_log_path(id: "upload-your-file", form: { year:, needstype:, organisation_id: }.compact) |
||||
end |
||||
|
||||
def year_combo |
||||
"#{year} to #{year + 1}" |
||||
end |
||||
|
||||
def save! |
||||
true |
||||
end |
||||
end |
||||
end |
||||
end |
@ -1,23 +0,0 @@
|
||||
<% content_for :before_content do %> |
||||
<%= govuk_back_link href: @form.back_path %> |
||||
<% end %> |
||||
|
||||
<div class="govuk-grid-row"> |
||||
<div class="govuk-grid-column-two-thirds-from-desktop"> |
||||
<%= form_with model: @form, scope: :form, url: bulk_upload_lettings_log_path(id: "needstype"), method: :patch do |f| %> |
||||
<%= f.govuk_error_summary %> |
||||
<%= f.hidden_field :year %> |
||||
<%= f.hidden_field :organisation_id %> |
||||
|
||||
<%= f.govuk_collection_radio_buttons :needstype, |
||||
@form.options, |
||||
:id, |
||||
:name, |
||||
hint: { text: I18n.t("hints.bulk_upload.needstype") }, |
||||
legend: { text: "What is the needs type?", size: "l" }, |
||||
caption: { text: "Upload lettings logs in bulk (#{@form.year_combo})", size: "l" } %> |
||||
|
||||
<%= f.govuk_submit %> |
||||
<% end %> |
||||
</div> |
||||
</div> |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue