From 1e82f873c793f280c88af85e0cd7814760bc8c13 Mon Sep 17 00:00:00 2001 From: aram price Date: Mon, 19 Aug 2024 16:22:14 -0700 Subject: [PATCH] Add workflow to run unit specs --- .github/workflows/ruby.yml | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/ruby.yml diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 00000000000..8769f037f36 --- /dev/null +++ b/.github/workflows/ruby.yml @@ -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_mysql: + 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 mysql.service + - run: mysql --user=root --password=root -e "CREATE USER '$(whoami)'@'localhost' IDENTIFIED BY '$(whoami)';" + - run: mysql --user=root --password=root -e "GRANT ALL PRIVILEGES ON *.* TO '$(whoami)'@'localhost';" + - run: bundle + working-directory: src/ + - run: DB=mysql DB_USER=$(whoami) DB_PASSWORD=$(whoami) bundle exec rake spec:unit:director:parallel + working-directory: src/ + +# unit_specs_director_postgres: +# 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 $(whoami) +# - run: sudo -u postgres psql --command "alter user $(whoami) with encrypted password '$(whoami)'" +# - run: bundle +# working-directory: src/ +# - run: DB=postgresql DB_USER=$(whoami) DB_PASSWORD=$(whoami) bundle exec rake spec:unit:director:parallel +# working-directory: src/