Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
arminmeh committed Nov 19, 2024
1 parent de110de commit 2caa584
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 38 deletions.
62 changes: 24 additions & 38 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,57 +12,43 @@ Possible values for `version`:
- a tag on npm, for example `next`, `experimental` or `latest`
- an older version, for example `^17.0.0`

### CI
## Testing multiple versions of Material UI

Currently, we use `@mui/material` v5 in the MUI X repo and all tests are run against it.

Check warning on line 17 in test/README.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'we'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'we'.", "location": {"path": "test/README.md", "range": {"start": {"line": 17, "column": 12}}}, "severity": "WARNING"}
But MUI X packages are compatible with v5 and v6.
You can run the tests against `@mui/material` v6 by running the following command:

#### `next` version
`pnpm use-material-ui-v6`

For `react@next` specifically, there's a `react-next` workflow in our CircleCI pipeline that you can trigger in CircleCI on the PR you want to test:
## CI

1. Go to https://app.circleci.com/pipelines/github/mui/mui-x?branch=pull/PR_NUMBER and replace `PR_NUMBER` with the PR number you want to test.
2. Click `Trigger Pipeline` button.
3. Expand `Add parameters (optional)` and add the following parameter:
To execute additional jobs for custom versions of React/Material UI, you can use `additional` workflow. In combination with `with-react-version` and/or `with-material-ui-6` parameters, it executes those jobs with dependency versions different from the main `pipeline` workflow.

Check failure on line 25 in test/README.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [MUI.MuiBrandName] Use a non-breaking space (option+space on Mac, Alt+0160 on Windows or AltGr+Space on Linux, instead of space) for brand name ('Material UI' instead of 'Material UI') Raw Output: {"message": "[MUI.MuiBrandName] Use a non-breaking space (option+space on Mac, Alt+0160 on Windows or AltGr+Space on Linux, instead of space) for brand name ('Material UI' instead of 'Material UI')", "location": {"path": "test/README.md", "range": {"start": {"line": 25, "column": 57}}}, "severity": "ERROR"}

| Parameter type | Name | Value |
| :------------- | :--------- | :----------- |
| `string` | `workflow` | `react-next` |
| Parameter type | Name | Value |
| :------------- | :------------------- | :------------------- |
| `string` | `workflow` | `additional` |
| `string` | `with-react-version` | `<VERSION_OF_REACT>` |
| `boolean` | `with-material-ui-6` | `true` or `false` |

1. Go to https://app.circleci.com/pipelines/github/mui/mui-x?branch=pull/PR_NUMBER and replace `PR_NUMBER` with the PR number you want to test.
2. Click `Trigger Pipeline` button.
3. Go to the `Parameters` section and update the `workflow` parameter in combination with the version parameter(s).
You can leave the rest of the parameters with their default values.
4. Click `Trigger Pipeline` button.

#### Other versions
![CircleCI workflow](./circleci-workflow.png)

### API

You can pass the same `version` to our CircleCI pipeline as well:
You can pass the same to our CircleCI pipeline through API as well:

Check warning on line 43 in test/README.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'our'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'our'.", "location": {"path": "test/README.md", "range": {"start": {"line": 43, "column": 26}}}, "severity": "WARNING"}

With the following API request we're triggering a run of the default workflow in
PR #24289 for `react@next`
With the following API request we're triggering a run of the `additional` workflow in

Check warning on line 45 in test/README.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'we'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'we'.", "location": {"path": "test/README.md", "range": {"start": {"line": 45, "column": 32}}}, "severity": "WARNING"}
PR #24289 for `react@rc` and `@mui/material-ui@6`

```bash
curl --request POST \
--url https://circleci.com/api/v2/project/gh/mui/mui-x/pipeline \
--header 'content-type: application/json' \
--header 'Circle-Token: $CIRCLE_TOKEN' \
--data-raw '{"branch":"pull/24289/head","parameters":{"react-version":"next"}}'
--data-raw '{"branch":"pull/24289/head","parameters":{"workflow":"additional","with-react-version":"rc","with-material-ui-6":true}}'
```

## Testing multiple versions of Material UI

Currently, we use `@mui/material` v5 in the MUI X repo and all tests are run against it.
But MUI X packages are compatible with v5 and v6.
You can run the tests against `@mui/material` v6 by running the following command:

`pnpm use-material-ui-v6`

### CI

There's a `material-ui-v6` workflow in our CircleCI pipeline that you can trigger in CircleCI on the PR you want to test:

1. Go to https://app.circleci.com/pipelines/github/mui/mui-x?branch=pull/PR_NUMBER and replace `PR_NUMBER` with the PR number you want to test.
2. Click `Trigger Pipeline` button.
3. Expand `Add parameters (optional)` and add the following parameter:

| Parameter type | Name | Value |
| :------------- | :--------- | :--------------- |
| `string` | `workflow` | `material-ui-v6` |

4. Click `Trigger Pipeline` button.

![CircleCI workflow](./circleci-workflow.png)
Binary file modified test/circleci-workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2caa584

Please sign in to comment.