Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .github/actions/cache-node-modules/action.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/actions/cache-package-builds/action.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
name: 'Install Node Dependencies'
description: 'Install monorepo dependencies using yarn'
name: Install Node Dependencies
description: Install dependencies using yarn
runs:
using: 'composite'
using: composite
steps:
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
shell: bash
- name: Cache yarn cache

- name: Sync yarn cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Cache node modules
uses: ./.github/actions/cache-node-modules
- name: Install dependencies
run: yarn install --immutable

- name: Sync node_modules cache
id: sync-node-modules-cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ env.NODE_VERSION }}-${{ hashFiles('./yarn.lock') }}

- name: Install node_modules
run: if [ '${{ steps.sync-node-modules-cache.outputs.cache-hit }}' != 'true' ]; then yarn install --immutable; fi
shell: bash
16 changes: 10 additions & 6 deletions .github/actions/package/action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: Run package
description: Package all libraries in the monorepo
description: Package packages in the monorepo
runs:
using: composite
steps:
- name: Cache package builds
id: package-cache
uses: ./.github/actions/cache-package-builds
- name: Run package
run: if [ '${{ steps.package-cache.outputs.cache-hit }}' != 'true' ]; then yarn package; fi
- name: Sync packages cache
id: sync-packages-cache
uses: actions/cache@v2
with:
path: |
node_modules/@castore/**/dist
key: ${{ hashFiles('./packages/**') }}-${{ hashFiles('./demo/**') }}
- name: Package
run: if [ '${{ steps.sync-packages-cache.outputs.cache-hit }}' != 'true' ]; then yarn package; fi
shell: bash
13 changes: 9 additions & 4 deletions .github/workflows/release-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ jobs:
with:
ref: main
fetch-depth: 0
- name: Install & cache node dependencies
uses: ./.github/actions/install-node-deps
- name: Build packages
run: yarn package

- name: Install node_modules
uses: ./.github/actions/install-node-modules

- name: Package
uses: ./.github/actions/package

- name: Set packages versions
run: yarn set-packages-versions ${{ github.event.release.tag_name }}

- name: Copy paste root README to @castore/core
run: cp README.md ./packages/core/README.md

- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0
- name: Install & cache node dependencies
uses: ./.github/actions/install-node-deps
- name: Package and cache builds

- name: Install node_modules
uses: ./.github/actions/install-node-modules

- name: Package
uses: ./.github/actions/package

lint-and-tests:
Expand All @@ -45,8 +47,13 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
- name: Use cached project dependencies
uses: ./.github/actions/cache-node-modules

- name: Install node_modules
uses: ./.github/actions/install-node-modules

- name: Package
uses: ./.github/actions/package

- name: Run tests
run: yarn nx run-many --all --target=test --parallel=1

Expand Down