refactor(code): improve readability and maintainability #84
Workflow file for this run
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: CI | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| checks: | |
| name: Checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| id: checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v5 | |
| - name: Setup Node | |
| id: setup-node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .node-version | |
| cache: pnpm | |
| - name: Install Dependencies | |
| id: install | |
| run: pnpm install --frozen-lockfile | |
| - name: Check Format | |
| id: format-check | |
| run: pnpm run fmt:check | |
| - name: Lint | |
| id: lint | |
| run: pnpm run lint | |
| - name: Test | |
| id: test | |
| run: pnpm run ci-test | |
| - name: Build | |
| id: build | |
| run: pnpm run build | |
| - name: Check dist/ is up-to-date | |
| id: diff | |
| run: | | |
| if [ ! -d dist/ ]; then | |
| echo "Expected dist/ directory does not exist. See status below:" | |
| ls -la ./ | |
| exit 1 | |
| fi | |
| if ! git diff --ignore-space-at-eol --text --quiet dist/; then | |
| echo "Detected uncommitted changes after build. See status below:" | |
| git diff --ignore-space-at-eol --text dist/ | |
| exit 1 | |
| fi | |
| - if: ${{ failure() && steps.diff.outcome == 'failure' }} | |
| name: Upload dist/ artifact | |
| id: upload | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: dist | |
| path: dist/ | |
| test-action: | |
| name: GitHub Actions Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| id: checkout | |
| uses: actions/checkout@v6 | |
| - name: Test Local Action | |
| id: test-action | |
| uses: ./ | |
| with: | |
| preid: "dev" | |
| - name: Print Output | |
| id: output | |
| run: echo "${{ steps.test-action.outputs.version }}" |