Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 8 additions & 7 deletions .github/workflows/matrix.js → .github/workflows/matrix.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// The script generates a random subset of valid jdk, os, timezone, and other axes.
// You can preview the results by running "node matrix.js"
// You can preview the results by running "node matrix.mjs"
// See https://github.com/vlsi/github-actions-random-matrix
let fs = require('fs');
let os = require('os');
let {MatrixBuilder} = require('./matrix_builder');
const matrix = new MatrixBuilder();
import { appendFileSync } from 'fs';
import { EOL } from 'os';
import { createGitHubMatrixBuilder } from '@vlsi/github-actions-random-matrix/github';
const { matrix, random } = createGitHubMatrixBuilder();

matrix.addAxis({
name: 'java_distribution',
values: [
Expand Down Expand Up @@ -119,7 +120,7 @@ include.forEach(v => {
v.oracle_java_website = v.java_version === eaJava ? 'jdk.java.net' : 'oracle.com';
}
v.non_ea_java_version = v.java_version === eaJava ? '' : v.java_version;
if (v.java_distribution !== 'semeru' && Math.random() > 0.5) {
if (v.java_distribution !== 'semeru' && random() > 0.5) {
// The following options randomize instruction selection in JIT compiler
// so it might reveal missing synchronization in TestNG code
v.name += ', stress JIT';
Expand Down Expand Up @@ -149,7 +150,7 @@ include.forEach(v => {
console.log(include);
let filePath = process.env['GITHUB_OUTPUT'] || '';
if (filePath) {
fs.appendFileSync(filePath, `matrix<<MATRIX_BODY${os.EOL}${JSON.stringify({include})}${os.EOL}MATRIX_BODY${os.EOL}`, {
appendFileSync(filePath, `matrix<<MATRIX_BODY${EOL}${JSON.stringify({include})}${EOL}MATRIX_BODY${EOL}`, {
encoding: 'utf8'
});
}
255 changes: 0 additions & 255 deletions .github/workflows/matrix_builder.js

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .github/workflows/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"private": true,
"type": "module",
"dependencies": {
"@vlsi/github-actions-random-matrix": "2.0.0"
}
}
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ jobs:
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
env:
# Ask matrix.js to produce 7 jobs
# Ask matrix.mjs to produce 7 jobs
MATRIX_JOBS: 7
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- id: set-matrix
run: |
node .github/workflows/matrix.js
npm ci --prefix .github/workflows
node .github/workflows/matrix.mjs

build:
needs: matrix_prep
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ z_build
outputDir/
**/Version.java
**/bin/
node_modules
Loading