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 9b2cea7
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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
strategy:
matrix:
db:
- mysql
- postgresql
steps:
- uses: actions/checkout@v4
with: { lfs: true}
- uses: ruby/setup-ruby@v1
with: { working-directory: src/ }

- if: ${{ matrix.db == 'mysql' }}
run: |
sudo systemctl start mysql.service
mysql --user=root --password=root -e "CREATE USER '$(whoami)'@'localhost' IDENTIFIED BY '$(whoami)';"
mysql --user=root --password=root -e "GRANT ALL PRIVILEGES ON *.* TO '$(whoami)'@'localhost';"
- if: ${{ matrix.db == 'postgresql' }}
run: |
sudo systemctl start postgresql.service
sudo -u postgres createuser --superuser $(whoami)
sudo -u postgres psql --command "alter user $(whoami) with encrypted password '$(whoami)'"
- run: bundle
working-directory: src/
- run: DB=${{matrix.db}} DB_USER=$(whoami) DB_PASSWORD=$(whoami) bundle exec rake spec:unit:director:parallel
working-directory: src/

0 comments on commit 9b2cea7

Please sign in to comment.