-
Notifications
You must be signed in to change notification settings - Fork 656
53 lines (48 loc) · 1.55 KB
/
ruby.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Run Specs
on: [push, pull_request]
jobs:
unit_specs:
runs-on: ubuntu-latest
strategy:
matrix:
sub_project:
- common:parallel
- monitor:parallel
- nats_sync:parallel
- template:parallel
- release
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}}
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/