🚀 major #30
Workflow file for this run
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: PR Check | |
on: [pull_request] | |
jobs: | |
init: | |
runs-on: ubuntu-latest | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
cache-name: cache-node-modules | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set git config | |
run: | | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: "package.json" | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.9.2 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store-${{ env.cache-name }}- | |
- name: Install Node Dependencies | |
run: pnpm install | |
- name: Set .npmrc | |
run: echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc | |
# Output the cache-name environment variable | |
# so that it can be used in other jobs | |
outputs: | |
cache-name: ${{ env.cache-name }} | |
type-check: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: init | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- uses: pnpm/action-setup@v2 | |
- uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-pnpm-store-${{ needs.init.outputs.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Type check | |
run: pnpm vsm gen:unimport-type && pnpm vsm lint:type-check | |
eslint-check: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: init | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- uses: pnpm/action-setup@v2 | |
- uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-pnpm-store-${{ needs.init.outputs.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: ESlint check | |
run: pnpm vsm lint | |
stylelint-check: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: init | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- uses: pnpm/action-setup@v2 | |
- uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-pnpm-store-${{ needs.init.outputs.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Stylelint check | |
run: pnpm vsm lint:css | |
build-check: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: init | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- uses: pnpm/action-setup@v2 | |
- uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-pnpm-store-${{ needs.init.outputs.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Build check | |
run: pnpm vsm gen:unimport-type && pnpm vsm build | |
publish-check: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: [init, build-check] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- uses: pnpm/action-setup@v2 | |
- uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-pnpm-store-${{ needs.init.outputs.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Build check | |
run: pnpm vsm gen:unimport-type && pnpm vsm build | |
- name: Publish check | |
run: pnpm vsm publish --dry-run --no-git-checks |