feat: add Filesystem util and load env util (#7487)

This commit is contained in:
Harminder Virk
2024-05-28 15:31:13 +05:30
committed by GitHub
parent 164bb988e7
commit ef6d748784
24 changed files with 389 additions and 194 deletions

View File

@@ -1,5 +1,5 @@
name: Documentation Tests
on:
on:
pull_request:
paths:
- www/**
@@ -22,7 +22,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: "18"
node-version: 20
cache: "yarn"
- name: Install dependencies
@@ -44,7 +44,7 @@ jobs:
# TODO change once we have actual URLs
NEXT_PUBLIC_RESOURCES_URL: "http://example.com"
NEXT_PUBLIC_USER_GUIDE_URL: "http://example.com"
vale-book:
if: ${{ startsWith(github.head_ref, 'docs/') }}
runs-on: ubuntu-latest
@@ -75,7 +75,7 @@ jobs:
# an error state
- name: Get PR files number
working-directory: www/utils/packages/scripts
run: 'yarn check:pr-files-count ${{ github.ref_name }}'
run: "yarn check:pr-files-count ${{ github.ref_name }}"
id: pr-files
- name: Get Directories to Scan
@@ -90,13 +90,13 @@ jobs:
with:
files: ${{ steps.directories.outputs.LIST }}
fail_on_error: true
vale_flags: '--minAlertLevel=error'
vale_flags: "--minAlertLevel=error"
reporter: github-pr-check
token: ${{ github.token }}
filter_mode: nofilter
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
vale-resources:
if: ${{ startsWith(github.head_ref, 'docs/') }}
runs-on: ubuntu-latest
@@ -127,7 +127,7 @@ jobs:
# an error state
- name: Get PR files number
working-directory: www/utils/packages/scripts
run: 'yarn check:pr-files-count ${{ github.ref_name }}'
run: "yarn check:pr-files-count ${{ github.ref_name }}"
id: pr-files
- name: Get Directories to Scan
@@ -141,13 +141,13 @@ jobs:
with:
files: ${{ steps.directories.outputs.LIST }}
fail_on_error: true
vale_flags: '--minAlertLevel=error'
vale_flags: "--minAlertLevel=error"
reporter: github-pr-check
token: ${{ github.token }}
filter_mode: nofilter
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
vale-user-guide:
if: ${{ startsWith(github.head_ref, 'docs/') }}
runs-on: ubuntu-latest
@@ -178,7 +178,7 @@ jobs:
# an error state
- name: Get PR files number
working-directory: www/utils/packages/scripts
run: 'yarn check:pr-files-count ${{ github.ref_name }}'
run: "yarn check:pr-files-count ${{ github.ref_name }}"
id: pr-files
- name: Get Directories to Scan
@@ -192,13 +192,13 @@ jobs:
with:
files: ${{ steps.directories.outputs.LIST }}
fail_on_error: true
vale_flags: '--minAlertLevel=error'
vale_flags: "--minAlertLevel=error"
reporter: github-pr-check
token: ${{ github.token }}
filter_mode: nofilter
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
vale-ui:
if: ${{ startsWith(github.head_ref, 'docs/') }}
runs-on: ubuntu-latest
@@ -229,7 +229,7 @@ jobs:
# an error state
- name: Get PR files number
working-directory: www/utils/packages/scripts
run: 'yarn check:pr-files-count ${{ github.ref_name }}'
run: "yarn check:pr-files-count ${{ github.ref_name }}"
id: pr-files
- name: Get Directories to Scan
@@ -244,13 +244,13 @@ jobs:
with:
files: ${{ steps.directories.outputs.LIST }}
fail_on_error: true
vale_flags: '--minAlertLevel=error'
vale_flags: "--minAlertLevel=error"
reporter: github-pr-check
token: ${{ github.token }}
filter_mode: nofilter
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
vale-api:
if: ${{ startsWith(github.head_ref, 'docs/') }}
runs-on: ubuntu-latest
@@ -281,7 +281,7 @@ jobs:
# an error state
- name: Get PR files number
working-directory: www/utils/packages/scripts
run: 'yarn check:pr-files-count ${{ github.ref_name }}'
run: "yarn check:pr-files-count ${{ github.ref_name }}"
id: pr-files
- name: Get Directories to Scan
@@ -296,13 +296,13 @@ jobs:
with:
files: ${{ steps.directories.outputs.LIST }}
fail_on_error: true
vale_flags: '--minAlertLevel=error'
vale_flags: "--minAlertLevel=error"
reporter: github-pr-check
token: ${{ github.token }}
filter_mode: diff_context
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
content-eslint:
if: ${{ startsWith(github.head_ref, 'docs/') }}
runs-on: ubuntu-latest
@@ -324,7 +324,7 @@ jobs:
- name: Run Eslint
working-directory: www
run: yarn lint:content
code-docs-eslint:
if: ${{ startsWith(github.head_ref, 'docs/') }}
runs-on: ubuntu-latest
@@ -352,4 +352,4 @@ jobs:
- name: Run Eslint
working-directory: www
run: yarn lint
run: yarn lint