⬆️(dependencies) update js dependencies #133
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Frontend CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - "*" | |
| jobs: | |
| install-front: | |
| uses: ./.github/workflows/front-dependencies-installation.yml | |
| with: | |
| node_version: "20.x" | |
| lint-git: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check absence of fixup commits | |
| run: | | |
| ! git log origin/${{ github.event.pull_request.base.ref }}..HEAD | grep 'fixup!' | |
| - name: Install gitlint | |
| run: pip install --user requests gitlint | |
| - name: Lint commit messages added to main | |
| run: ~/.local/bin/gitlint --commits origin/${{ github.event.pull_request.base.ref }}..HEAD | |
| check-renovate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| - name: Validate renovate configuration | |
| run: npx --yes --package renovate -- renovate-config-validator | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: install-front | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| - name: Restore the frontend cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/demo/node_modules | |
| packages/eslint-config-custom/node_modules | |
| packages/react/node_modules | |
| packages/tokens/node_modules | |
| key: front-node_modules-${{ hashFiles('yarn.lock') }} | |
| fail-on-cache-miss: true | |
| - name: Build packages | |
| run: | | |
| ln -sf ../../packages/tokens/dist/bin/Main.js node_modules/.bin/cunningham | |
| yarn build | |
| - name: Upload dist artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-artifacts | |
| path: | | |
| apps/demo/dist | |
| packages/tokens/dist | |
| packages/tokens/src/lib/cunningham.ts | |
| packages/react/dist | |
| lint: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - install-front | |
| - build | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| - name: Restore the frontend cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/demo/node_modules | |
| packages/eslint-config-custom/node_modules | |
| packages/react/node_modules | |
| packages/tokens/node_modules | |
| key: front-node_modules-${{ hashFiles('yarn.lock') }} | |
| fail-on-cache-miss: true | |
| - name: Download dist artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist-artifacts | |
| - name: Check linting | |
| run: yarn lint | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - install-front | |
| - build | |
| - lint | |
| strategy: | |
| matrix: | |
| shard: [1, 2, 3, 4] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| - name: Restore the frontend cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/demo/node_modules | |
| packages/eslint-config-custom/node_modules | |
| packages/react/node_modules | |
| packages/tokens/node_modules | |
| key: front-node_modules-${{ hashFiles('yarn.lock') }} | |
| fail-on-cache-miss: true | |
| - name: Download dist artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist-artifacts | |
| - name: Restore execute permissions | |
| run: chmod +x packages/tokens/dist/bin/Main.js | |
| - name: Run test suites | |
| env: | |
| SHARD_INDEX: ${{ matrix.shard }} | |
| SHARD_TOTAL: 4 | |
| run: yarn test-ci | |
| crowdin-upload: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| needs: build | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Upload sources to Crowdin | |
| uses: crowdin/github-action@v2 | |
| with: | |
| upload_sources: true | |
| upload_translations: false | |
| download_translations: false | |
| config: crowdin/config.yml | |
| env: | |
| CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }} | |
| CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | |
| CROWDIN_BASE_PATH: ${{ github.workspace }} | |
| deploy-storybook: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| needs: | |
| - install-front | |
| - test | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| - name: Restore the frontend cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/demo/node_modules | |
| packages/eslint-config-custom/node_modules | |
| packages/react/node_modules | |
| packages/tokens/node_modules | |
| key: front-node_modules-${{ hashFiles('yarn.lock') }} | |
| fail-on-cache-miss: true | |
| - name: Download dist artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist-artifacts | |
| - name: Deploy to GitHub Pages | |
| run: | | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git config user.name "github-actions[bot]" | |
| yarn deploy-ghpages | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| publish-packages: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| needs: | |
| - install-front | |
| - test | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Restore the frontend cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/demo/node_modules | |
| packages/eslint-config-custom/node_modules | |
| packages/react/node_modules | |
| packages/tokens/node_modules | |
| key: front-node_modules-${{ hashFiles('yarn.lock') }} | |
| fail-on-cache-miss: true | |
| - name: Download dist artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist-artifacts | |
| - name: Configure git identity | |
| run: | | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git config user.name "github-actions[bot]" | |
| - name: Publish packages | |
| run: yarn changeset publish | |
| env: | |
| NPM_CONFIG_PROVENANCE: true | |
| - name: Push release tags | |
| run: git push --follow-tags origin HEAD |