π enhance CommitList tests for input handling and error display; refaβ¦ #39
This file contains 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: CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: π οΈ Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: π Clear Cache | |
run: npm run clean | |
- name: π Ensure package-lock.json is up-to-date | |
run: npm install --package-lock-only --ignore-scripts --legacy-peer-deps | |
- name: π¦ Install dependencies | |
run: npm ci --legacy-peer-deps | |
- name: πΆ Set up Husky | |
run: npx husky install | |
- name: ποΈ Format code | |
run: npm run format | |
- name: π§Ή Lint code | |
run: npm run lint | |
- name: π Generate test files | |
run: npm run generate-tests | |
- name: ποΈ Format generated test files | |
run: npm run format | |
- name: π¨ Build | |
run: npm run build | |
- name: π§ͺ Test with coverage | |
run: npm run test | |
- name: π€ Commit and push generated test files | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
if ls src/**/*.test.tsx 1> /dev/null 2>&1; then | |
git add -A src/**/*.test.tsx # Include untracked files | |
git commit -m 'π€ Generated unit tests' | |
git push || echo "No changes to push." | |
else | |
echo "No test files to commit. Skipping this step." | |
fi | |
shell: /usr/bin/bash -e {0} | |
# Deploy build to GitHub Pages | |
- name: π Deploy dist to GitHub Pages | |
if: ${{ github.ref == 'refs/heads/main' }} | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist | |
publish_branch: gh-pages |