Add workflow to run unit specs #77
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ } | |
- run: export DB=${{matrix.db}} DB_USER=db_user DB_PASSWORD=db_password | |
- if: ${{ matrix.db == 'mysql' }} | |
run: | | |
sudo systemctl start mysql.service | |
mysql --user=root --password=root -e "CREATE USER '${DB_USER}'@'localhost' IDENTIFIED BY '${DB_PASSWORD}';" | |
mysql --user=root --password=root -e "GRANT ALL PRIVILEGES ON *.* TO '${DB_USER}'@'localhost';" | |
- if: ${{ matrix.db == 'postgresql' }} | |
run: | | |
sudo systemctl start postgresql.service | |
sudo -u postgres createuser --superuser ${DB_USER} | |
sudo -u postgres psql --command "alter user ${DB_USER} with encrypted password '${DB_PASSWORD}'" | |
- run: bundle install | |
working-directory: src/ | |
- run: bundle exec rake spec:unit:director:parallel | |
working-directory: src/ |