Skip to content

Commit

Permalink
104 Remove cp from ruby.yml workflow (#106)
Browse files Browse the repository at this point in the history
* Remove cp from ruby.yml workflow

* change workflow of tests to production

* return to rails env test in pipeline

* remove database.ci and return production configs to database.yml

* Reorder process in ruby.yml

* Rollback setup-ruby@v1

* Update codeclimate-action to v6.0.0

* remove problematic and not useful test

* change postgres:12 to alpine version in ruby.yml
  • Loading branch information
0jonjo authored May 5, 2024
1 parent 340c003 commit 71de355
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 37 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

services:
postgres:
image: postgres:12
image: postgres:12-alpine
ports: ['5432:5432']
env:
POSTGRES_PASSWORD: password
Expand All @@ -31,34 +31,34 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get -yqq install libpq-dev
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.5
bundler-cache: true

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get -yqq install libpq-dev
bundle install --jobs 4 --retry 3
- name: Install Ruby dependencies
run: bundle install --jobs 4 --retry 3

- name: Analyze code
run: |
bundle exec rubocop
run: bundle exec rubocop

- name: Run tests
env:
RAILS_ENV: test
PGHOST: localhost
DISABLE_SPRING: 1
run: |
cp config/database.ci.yml config/database.yml
bundle exec rails db:schema:load
bundle exec rspec --format progress
- name: Publish code coverage
uses: paambaati/codeclimate-action@v3.0.0
uses: paambaati/codeclimate-action@v6.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
7 changes: 0 additions & 7 deletions config/database.ci.yml

This file was deleted.

7 changes: 5 additions & 2 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ default: &default
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
# url: <%= ENV["DATABASE_URL"] %>
port: 5439
# port: 5439

development:
<<: *default
database: alljobs_development

test:
<<: *default
database: alljobs_test
# database: alljobs_test
database: <%= ENV["POSTGRES_DB"] %>
username: <%= ENV['POSTGRES_USER'] %>
password: <%= ENV["POSTGRES_PASSWORD"] %>

production:
<<: *default
Expand Down
18 changes: 0 additions & 18 deletions spec/system/job_opening/user_searches_for_a_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,6 @@
expect(page).to have_link(job.title)
end

xit 'search with sucess, only correct results' do
allow(SecureRandom).to receive(:alphanumeric).with(8).and_return('ABC12345')
job1 = create(:job)
allow(SecureRandom).to receive(:alphanumeric).with(8).and_return('ABC54321')
job2 = create(:job)
allow(SecureRandom).to receive(:alphanumeric).with(8).and_return('ZZZZZZZZ')
create(:job)

visit root_path
fill_in I18n.t('search_job'), with: 'ABC'
click_on I18n.t('search')

expect(page).to have_content('ABC')
expect(page).to have_content(job1.code)
expect(page).to have_content(job2.code)
expect(page).not_to have_content('ZZZZZZZZ')
end

it 'search with sucess, no one result' do
visit root_path
fill_in I18n.t('search_job'), with: 'ZZZZZZZ'
Expand Down

0 comments on commit 71de355

Please sign in to comment.