Merge pull request #73 from dipiash/update-deps #183
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@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Cache data for pnpm and node_modules | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.pnpm-store | |
**/node_modules | |
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}- | |
- uses: pnpm/[email protected] | |
with: | |
version: 8 | |
run_install: true | |
type-check: | |
runs-on: ubuntu-latest | |
needs: | |
- cache-and-install | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Reusable Action for PNPM and NX | |
uses: dipiash/pnpm-nx-reusable-action@v8 | |
- 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@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Reusable Action for PNPM and NX | |
uses: dipiash/pnpm-nx-reusable-action@v8 | |
- 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@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Reusable Action for PNPM and NX | |
uses: dipiash/pnpm-nx-reusable-action@v8 | |
- 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@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Reusable Action for PNPM and NX | |
uses: dipiash/pnpm-nx-reusable-action@v8 | |
- 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 | |