Skip to content

Commit

Permalink
Add i18n checks to PR workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Oct 1, 2024
1 parent a663a84 commit fbe61b7
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 13 deletions.
59 changes: 46 additions & 13 deletions .github/workflows/build_and_test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ env:
NODE_OPTIONS: '--max-old-space-size=6144 --dns-result-order=ipv4first'

jobs:
build-lint-test:
build-test:
name: Build and Verify on ${{ matrix.name }} (ciGroup${{ matrix.group }})
strategy:
fail-fast: false
Expand Down Expand Up @@ -104,18 +104,6 @@ jobs:
if: matrix.os == 'windows-latest'
run: yarn osd bootstrap || yarn osd bootstrap

- name: Run linter
# ciGroup 1 of unit-tests is shorter and Linux is faster
if: matrix.group == 1 && matrix.os == 'ubuntu-latest'
id: linter
run: yarn lint

- name: Validate NOTICE file
# ciGroup 1 of unit-tests is shorter and Linux is faster
if: matrix.group == 1 && matrix.os == 'ubuntu-latest'
id: notice-validate
run: yarn notice:validate

- name: Run unit tests group ${{ matrix.group }} with coverage
id: unit-tests
run: yarn test:jest:ci:coverage --ci-group=${{ matrix.group }}
Expand All @@ -140,6 +128,51 @@ jobs:
id: integration-tests
run: yarn test:jest_integration:ci

lint-and-validate:
name: Lint and validate
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Setup Yarn
run: |
npm uninstall -g yarn
npm i -g [email protected]
yarn config set network-timeout 1000000 -g
- name: Configure Yarn Cache
run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV

- name: Initialize Yarn Cache
uses: actions/cache@v3
with:
path: ${{ env.YARN_CACHE_LOCATION }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-
- name: Run bootstrap
run: yarn osd bootstrap

- name: Run linter
id: linter
run: yarn lint

- name: Validate NOTICE file
id: notice-validate
run: yarn notice:validate

- name: Check i18n
id: i18n-check
run: yarn i18n:check

functional-tests:
name: Run functional tests on ${{ matrix.name }} (ciGroup${{ matrix.group }})
strategy:
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
"lint": "yarn run lint:es && yarn run lint:style",
"lint:es": "scripts/use_node scripts/eslint",
"lint:style": "scripts/use_node scripts/stylelint",
"i18n:check": "scripts/use_node scripts/i18n_check",
"i18n:extract": "scripts/use_node scripts/i18n_extract.js",
"makelogs": "scripts/use_node scripts/makelogs",
"uiFramework:compileCss": "cd packages/osd-ui-framework && yarn compileCss",
"osd:watch": "scripts/use_node scripts/opensearch_dashboards --dev --logging.json=false",
Expand Down

0 comments on commit fbe61b7

Please sign in to comment.