11name : Test foreman plugins with foreman-js
22on : [push, pull_request, workflow_dispatch]
33
4+ env :
5+ BUNDLE_WITHOUT : " console:development:journald:libvirt"
6+
7+
48jobs :
59 test-plugins :
610 runs-on : ubuntu-latest
@@ -11,17 +15,16 @@ jobs:
1115 - repo : katello
1216 org : Katello
1317 use-foreman : true
18+ ruby : 2.7
1419 - repo : foreman-tasks
1520 org : theforeman
16- use-foreman : false
21+ use-foreman : true
22+ ruby : 2.7
1723 steps :
18- - uses : ruby/setup-ruby@v1
19- with :
20- ruby-version : 2.7
2124 - name : Use Node.js
2225 uses : actions/setup-node@v1
2326 with :
24- node-version : 14 .x
27+ node-version : 18 .x
2528 - name : Checkout foreman-js
2629 uses : actions/checkout@v2
2730 with :
@@ -39,16 +42,29 @@ jobs:
3942 repository : ${{ matrix.org }}/${{ matrix.repo }}
4043 ref : ${{ matrix.ref }}
4144 path : ./projects/${{ matrix.repo }}
45+ - name : Set up plugin in Foreman
46+ run : |
47+ echo "gemspec name: '${{ matrix.repo }}', path: '${{ github.workspace }}/projects/${{ matrix.repo }}'" > "bundler.d/${{ matrix.repo }}.local.rb"
48+ if [ -d ${{ matrix.repo }}/gemfile.d ] ; then
49+ cat ${{ matrix.repo }}/gemfile.d/*.rb >> bundler.d/${{ matrix.repo }}.local.rb
50+ fi
51+ working-directory : ${{ github.workspace }}/projects/foreman
52+ - name : " Set up Ruby ${{ matrix.ruby }}"
53+ uses : ruby/setup-ruby@v1
54+ with :
55+ ruby-version : ${{ matrix.ruby }}
56+ bundler-cache : true
57+ working-directory : ${{ github.workspace }}/projects/foreman
4258 - name : Install foreman-js npm dependencies
43- run : npm install
59+ run : npm install --legacy-peer-deps
4460 working-directory : ${{ github.workspace }}/projects/foreman-js
4561 - name : Install foreman npm dependencies
4662 if : ${{ matrix.use-foreman }}
4763 run : npm install
4864 working-directory : ${{ github.workspace }}/projects/foreman
4965 - name : Install ${{ matrix.repo }} npm dependencies
5066 if : ${{ matrix.repo != 'foreman' }}
51- run : npm install
67+ run : npm install --legacy-peer-deps
5268 working-directory : ${{ github.workspace }}/projects/${{ matrix.repo }}
5369 - name : Link foreman-js to foreman
5470 if : ${{ matrix.use-foreman }}
5874 run : npm run link -- --location '${{ github.workspace }}/projects/${{ matrix.repo }}'
5975 working-directory : ${{ github.workspace }}/projects/foreman-js
6076 - name : Run ${{ matrix.repo }} tests
61- run : npm test
62- working-directory : ${{ github.workspace }}/projects/${{ matrix.repo }}
77+ run : npm run test:plugins ${{ matrix.repo }}
78+ working-directory : ${{ github.workspace }}/projects/foreman
6379 - name : Run ${{ matrix.repo }} lint
64- run : npm run lint
65- working-directory : ${{ github.workspace }}/projects/${{ matrix.repo }}
80+ run : npm run lint:plugins ${{ matrix.repo }}
81+ working-directory : ${{ github.workspace }}/projects/foreman
0 commit comments