style(lint): update test imports and exclude tests from pre-commit lint #4
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: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| packages: write | |
| id-token: write | |
| jobs: | |
| quality: | |
| name: Quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - uses: pnpm/action-setup@v4 | |
| - run: pnpm install --frozen-lockfile | |
| - uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: turbo-quality-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }} | |
| restore-keys: | | |
| turbo-quality-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}- | |
| turbo-quality-${{ runner.os }}- | |
| - run: turbo run _typecheck _test | |
| docs: | |
| name: Docs | |
| runs-on: ubuntu-latest | |
| needs: quality | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - uses: pnpm/action-setup@v4 | |
| - run: pnpm install --frozen-lockfile | |
| - uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: turbo-docs-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }} | |
| restore-keys: | | |
| turbo-docs-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}- | |
| turbo-docs-${{ runner.os }}- | |
| - run: turbo run _docs:cli _docs:api:html | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: site/ | |
| pages: | |
| name: Deploy Pages | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| needs: docs | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deploy.outputs.page_url }} | |
| permissions: | |
| pages: write | |
| id-token: write | |
| steps: | |
| - id: deploy | |
| uses: actions/deploy-pages@v4 | |
| release: | |
| name: Release | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| needs: quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| registry-url: "https://registry.npmjs.org" | |
| - uses: pnpm/action-setup@v4 | |
| - run: pnpm install --frozen-lockfile | |
| - uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: turbo-release-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }} | |
| restore-keys: | | |
| turbo-release-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}- | |
| turbo-release-${{ runner.os }}- | |
| - run: turbo run _compile _schema | |
| - name: Record pre-release version | |
| id: pre | |
| run: echo "version=$(npm pkg get version | tr -d '\"')" >> "$GITHUB_OUTPUT" | |
| - run: npx semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: "true" | |
| - name: Check if released | |
| id: released | |
| run: | | |
| CURRENT=$(npm pkg get version | tr -d '"') | |
| if [ "$CURRENT" != "${{ steps.pre.outputs.version }}" ]; then | |
| echo "new_version=$CURRENT" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Publish to GitHub Packages | |
| if: steps.released.outputs.new_version | |
| run: | | |
| npm pkg set name='@exadev/sysprom' | |
| npm publish --registry https://npm.pkg.github.com | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |