Skip to content

Commit

Permalink
Add workflow to run unit specs
Browse files Browse the repository at this point in the history
  • Loading branch information
aramprice committed Aug 23, 2024
1 parent 6d619dc commit 60b0365
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Run Specs
on: push #[push, pull_request]

jobs:
# unit_specs:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# sub_project:
# - common
# - core
# - dev
# - director-core
# - monitor
# - nats-sync
# - template
# steps:
# - uses: actions/checkout@v4
# with: { lfs: true}
# - uses: ruby/setup-ruby@v1
# with: { working-directory: src/ }
# - run: bundle install
# working-directory: src/
# - run: bundle exec rake spec:unit:${{matrix.sub_project}}:parallel
# working-directory: src/

unit_specs_director:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { lfs: true}
- uses: ruby/setup-ruby@v1
with: { working-directory: src/ }
- run: sudo systemctl start postgresql.service
- run: sudo -u postgres createuser --superuser runner
- run: bundle
working-directory: src/
- run: DB_USER=$(whoami) bundle exec rspec bosh-director/spec/unit/models/event_spec.rb
working-directory: src/
2 changes: 1 addition & 1 deletion src/bosh-dev/lib/bosh/dev/sandbox/postgresql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def create_db
@logger.info("Creating postgres database #{db_name}")
@runner.run(
"echo #{Shellwords.escape(%(CREATE DATABASE "#{db_name}";))} | " \
"psql #{connection_string.gsub(/#{@db_name}$/, 'postgres')} > /dev/null",
"psql #{connection_string.gsub(/#{@db_name}$/, 'postgres')}",
)
end

Expand Down

0 comments on commit 60b0365

Please sign in to comment.