forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (83 loc) · 3.74 KB
/
ci.yml
File metadata and controls
87 lines (83 loc) · 3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: CI
on:
push:
branches:
# should sync with ci-check.yml as a workaround to bypass github checks
- master
- next
- v*.x
pull_request:
paths-ignore:
# should sync with ci-check.yml as a workaround to bypass github checks
- 'docs/**'
permissions: {}
jobs:
continuous-releases:
name: Continuous releases
uses: mui/mui-public/.github/workflows/ci-base.yml@dd7db35e4c70c656b86a98cf9b4819e7a4105f48 # master
# Tests dev-only scripts across all supported dev environments
test-dev:
# l10nbot does not affect dev scripts.
if: ${{ github.actor != 'l10nbot' }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
permissions:
contents: read
pull-requests: write
steps:
- run: echo '${{ github.actor }}'
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# fetch all tags which are required for `pnpm release:changelog`
fetch-depth: 0
- name: Set up pnpm
uses: pnpm/action-setup@8912a9102ac27614460f54aedde9e1e7f9aec20d # v6.0.5
- name: Use Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '22.18.0'
cache: 'pnpm' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies
- run: pnpm install
- name: Cache Next.js build
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: docs/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('docs/**/*.js', 'docs/**/*.ts', 'docs/**/*.tsx', 'docs/**/*.jsx', 'docs/**/*.json', 'docs/**/*.md', 'docs/**/*.mdx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-
${{ runner.os }}-nextjs-
- run: pnpm release:build
- name: Build docs
run: pnpm docs:build
env:
NODE_OPTIONS: --max_old_space_size=6144
# macOS-latest has 3 CPUs, but we get "EMFILE: too many open files" errors with that parallelism
# Limit Next.js to 2 CPUs to prevent file descriptor exhaustion. Empty string uses os.availableParallelism()
NEXT_PARALLELISM: ${{ runner.os == 'macOS' && '2' || '' }}
GITHUB_AUTH: Bearer ${{ secrets.GITHUB_TOKEN }}
# - run: pnpm release:changelog
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Debug export-detail.json on when pnpm docs:build fails with EMFILE error
if: failure()
run: cat ./docs/.next/export-detail.json || true
- name: Extract Vale version
if: ${{ matrix.os == 'ubuntu-latest' }}
id: vale-version
run: |
VERSION=$(node -p "(require('./package.json').config && require('./package.json').config.valeVersion) || ''")
echo "vale_version=$VERSION" >> $GITHUB_OUTPUT
- uses: vale-cli/vale-action@d89dee975228ae261d22c15adcd03578634d429c # v2.1.1
continue-on-error: true # GitHub Action flag needed until https://github.com/errata-ai/vale-action/issues/89 is fixed
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
version: ${{ steps.vale-version.outputs.vale_version }}
# Errors should be more visible
fail_on_error: true
# The other reports don't work, not really https://github.com/reviewdog/reviewdog#reporters
reporter: github-pr-check
# Required, set by GitHub actions automatically:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
token: ${{secrets.GITHUB_TOKEN}}