Merge pull request #75 from dipiash/change-docs #190
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: Code check | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
# Nx 18 enables using plugins to infer targets by default | |
# This is disabled for existing workspaces to maintain compatibility | |
# For more info, see: https://nx.dev/concepts/inferred-tasks | |
NX_ADD_PLUGINS: false | |
jobs: | |
cache-and-install: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.16.0 | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- name: Install dependencies | |
run: npm ci --prefer-offline | |
type-check: | |
runs-on: ubuntu-latest | |
needs: | |
- cache-and-install | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- run: npm ci --prefer-offline | |
- uses: nrwl/nx-set-shas@v4 | |
- name: type-check PR | |
if: github.ref != 'refs/heads/main' | |
run: npx nx affected --target=type-check --base=origin/main --head=HEAD | |
- name: type-check Main | |
if: github.ref == 'refs/heads/main' | |
run: npx nx affected --target=type-check --base=origin/main~1 --head=origin/main | |
lint: | |
runs-on: ubuntu-latest | |
needs: | |
- cache-and-install | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- run: npm ci --prefer-offline | |
- uses: nrwl/nx-set-shas@v4 | |
- name: lint PR | |
if: github.ref != 'refs/heads/main' | |
run: npx nx affected --target=lint --base=origin/main --head=HEAD | |
- name: lint Main | |
if: github.ref == 'refs/heads/main' | |
run: npx nx affected --target=lint --base=origin/main~1 --head=origin/main | |
stylelint: | |
runs-on: ubuntu-latest | |
needs: | |
- cache-and-install | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- run: npm ci --prefer-offline | |
- uses: nrwl/nx-set-shas@v4 | |
- name: stylelint PR | |
if: github.ref != 'refs/heads/main' | |
run: npx nx affected --target=stylelint --base=origin/main --head=HEAD | |
- name: stylelint Main | |
if: github.ref == 'refs/heads/main' | |
run: npx nx affected --target=stylelint --base=origin/main~1 --head=origin/main | |
test: | |
runs-on: ubuntu-latest | |
needs: | |
- cache-and-install | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- run: npm ci --prefer-offline | |
- uses: nrwl/nx-set-shas@v4 | |
- name: test PR | |
if: github.ref != 'refs/heads/main' | |
run: npx nx affected --target=test --base=origin/main --head=HEAD | |
- name: test Main | |
if: github.ref == 'refs/heads/main' | |
run: npx nx affected --target=test --base=origin/main~1 --head=origin/main | |