Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use the values from matrix.json in JS tests #9880

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions .github/workflows/js_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,36 @@ permissions:
contents: read

jobs:
setup_matrix:
name: Setup matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.build_matrix.outputs.matrix }}
steps:
- name: Build test matrix
id: build_matrix
uses: theforeman/gha-matrix-builder@v0

test:
permissions:
checks: write # for coverallsapp/github-action to create new checks
contents: read # for actions/checkout to fetch code
runs-on: ubuntu-latest
needs: setup_matrix
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
node-version:
- 14
matrix: ${{ fromJson(needs.setup_matrix.outputs.matrix) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can somehow be smart and only test on the first Ruby version. Running the JS tests with all Ruby versions probably doesn't make sense.

Suggested change
matrix: ${{ fromJson(needs.setup_matrix.outputs.matrix) }}
matrix:
ruby:
- ${{ fromJson(needs.setup_matrix.outputs.matrix).ruby[0] }}
node: ${{ fromJson(needs.setup_matrix.outputs.matrix).node }}

But perhaps with webpack 5 the webpack config no longer executes Ruby to determine plugins (not sure, couldn't see it immediately) and it no longer needs Ruby.

steps:
- name: Checkout Foreman
uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Setup Node
ruby-version: ${{ matrix.ruby }}
- name: Setup Node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ matrix.node }}
- name: Generate npm dependencies package-lock
run: npm install --package-lock-only --no-audit
- name: Install npm dependencies
Expand Down