Skip to content

Commit 2c9dfd7

Browse files
committed
fix(root): update github tests to use theforeman/actions
BREAKING CHANGE: Uses foremans new test logic
1 parent 54c4907 commit 2c9dfd7

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

.github/workflows/test-with-foreman.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Use Node.js
1515
uses: actions/setup-node@v1
1616
with:
17-
node-version: 14.x
17+
node-version: 18.x
1818
- name: Checkout foreman-js
1919
uses: actions/checkout@v2
2020
with:
@@ -25,7 +25,7 @@ jobs:
2525
repository: theforeman/foreman
2626
path: ./projects/foreman
2727
- name: Install foreman-js npm dependencies
28-
run: npm install
28+
run: npm install --legacy-peer-deps
2929
working-directory: ${{ github.workspace }}/projects/foreman-js
3030
- name: Install foreman npm dependencies
3131
run: npm install

.github/workflows/test-with-plugins.yml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Test foreman plugins with foreman-js
22
on: [push, pull_request, workflow_dispatch]
33

4+
env:
5+
BUNDLE_WITHOUT: "console:development:journald:libvirt"
6+
7+
48
jobs:
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 }}
@@ -58,8 +74,8 @@ jobs:
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

Comments
 (0)