diff --git a/.github/workflows/foreman_plugin_js.yml b/.github/workflows/foreman_plugin_js.yml index 384acd8..2b170e3 100644 --- a/.github/workflows/foreman_plugin_js.yml +++ b/.github/workflows/foreman_plugin_js.yml @@ -4,6 +4,10 @@ name: Foreman Plugin JavaScript on: workflow_call: inputs: + plugin: + description: Plugin name + required: true + type: string plugin_repository: description: Plugin repository to use required: false @@ -85,7 +89,7 @@ jobs: with: repository: ${{ inputs.plugin_repository }} ref: ${{ inputs.plugin_version }} - path: ./plugin + path: ${{ inputs.plugin }} - name: "Set up Ruby ${{ matrix.ruby }}" uses: ruby/setup-ruby@v1 with: @@ -107,22 +111,22 @@ jobs: - name: "Install Foreman NPM packages" run: npm ci --no-audit --legacy-peer-deps working-directory: ./foreman - - name: "Build plugin package-lock.json" + - name: "Build ${{ inputs.plugin }} package-lock.json" run: npm install --package-lock-only --no-audit --legacy-peer-deps - working-directory: ./plugin - - name: "Install plugin NPM packages" + working-directory: ${{ inputs.plugin }} + - name: "Install ${{ inputs.plugin }} NPM packages" run: npm ci --no-audit --legacy-peer-deps - working-directory: ./plugin + working-directory: ${{ inputs.plugin }} - name: Archive package-lock.json uses: actions/upload-artifact@v4 with: name: package-lock-${{ env.ARTIFACT_SUFFIX }}.json path: | foreman/package-lock.json - plugin/package-lock.json - - name: Lint + ${{ format('{0}/package-lock.json', inputs.plugin) }} + - name: Lint ${{ matrix.plugin }} run: npm run lint - working-directory: ./plugin - - name: Run tests + working-directory: ${{ inputs.plugin }} + - name: Run ${{ matrix.plugin }} tests run: npm test - working-directory: ./plugin + working-directory: ${{ inputs.plugin }} diff --git a/.github/workflows/foreman_plugin_js_workflow_test.yml b/.github/workflows/foreman_plugin_js_workflow_test.yml index 1517e2a..17c1398 100644 --- a/.github/workflows/foreman_plugin_js_workflow_test.yml +++ b/.github/workflows/foreman_plugin_js_workflow_test.yml @@ -16,4 +16,5 @@ jobs: name: JavaScript uses: ./.github/workflows/foreman_plugin_js.yml with: + plugin: katello plugin_repository: Katello/katello