diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 559c9d74..914e9233 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,10 @@ jobs: name: Building and deploying storybook runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Derive appropriate SHAs for base and head for `nx affected` commands uses: nrwl/nx-set-shas@v3 with: @@ -67,10 +70,22 @@ jobs: echo "BASE: ${{ env.NX_BASE }}" echo "HEAD: ${{ env.NX_HEAD }}" - - name: Installing Node.js 19.x + - name: Installing Node.js 20.x uses: actions/setup-node@v3 with: - node-version: stable + node-version: 20.8.0 + + - name: Cache Yarn dependencies + uses: actions/cache@v2 + with: + path: | + ~/.cache/yarn + ~/.yarn/cache + .yarn/cache + node_modules + key: ${{ runner.os }}-yarn-${{ hashFiles('**/*.yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Installing dependencies run: yarn install diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 63b58af7..fc24739f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,7 +21,10 @@ jobs: name: Pushing workflow to build branch runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Derive appropriate SHAs for base and head for `nx affected` commands uses: nrwl/nx-set-shas@v3 with: @@ -35,11 +38,21 @@ jobs: uses: actions/setup-node@v3 with: node-version: 20.8.0 - cache: 'yarn' + - name: Cache Yarn dependencies + uses: actions/cache@v2 + with: + path: | + ~/.cache/yarn + ~/.yarn/cache + .yarn/cache + node_modules + key: ${{ runner.os }}-yarn-${{ hashFiles('**/*.yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Installing dependencies - run: yarn install --immutable-cache + run: yarn install - name: Pushing to build branch uses: s0/git-publish-subdir-action@develop @@ -55,7 +68,10 @@ jobs: name: Building and deploying storybook runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Derive appropriate SHAs for base and head for `nx affected` commands uses: nrwl/nx-set-shas@v3 with: @@ -65,14 +81,25 @@ jobs: echo "BASE: ${{ env.NX_BASE }}" echo "HEAD: ${{ env.NX_HEAD }}" - - name: Installing Node.js 19.x + - name: Installing Node.js 20.x uses: actions/setup-node@v3 with: - node-version: stable - cache: 'yarn' + node-version: 20.8.0 + + - name: Cache Yarn dependencies + uses: actions/cache@v2 + with: + path: | + ~/.cache/yarn + ~/.yarn/cache + .yarn/cache + node_modules + key: ${{ runner.os }}-yarn-${{ hashFiles('**/*.yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Installing dependencies - run: yarn install --immutable-cache + run: yarn install - name: Pushing to build-storybook branch uses: JamesIves/github-pages-deploy-action@v4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2cedfb49..47bc1092 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,10 @@ jobs: name: Linting project runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Derive appropriate SHAs for base and head for `nx affected` commands uses: nrwl/nx-set-shas@v3 with: @@ -30,10 +33,22 @@ jobs: uses: actions/setup-node@v3 with: node-version: 20.8.0 - cache: 'yarn' + + - name: Cache Yarn dependencies + uses: actions/cache@v2 + with: + path: | + ~/.cache/yarn + ~/.yarn/cache + .yarn/cache + node_modules + key: ${{ runner.os }}-yarn-${{ hashFiles('**/*.yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Installing dependencies - run: yarn install --immutable-cache + run: yarn install + - name: Linting project run: yarn dlx nx run root:lint diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8f88a96a..8c93d30a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,10 @@ jobs: needs: [build-storybook] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Derive appropriate SHAs for base and head for `nx affected` commands uses: nrwl/nx-set-shas@v3 with: @@ -34,10 +37,22 @@ jobs: uses: actions/setup-node@v3 with: node-version: 20.8.0 - cache: 'yarn' + + - name: Cache Yarn dependencies + uses: actions/cache@v2 + with: + path: | + ~/.cache/yarn + ~/.yarn/cache + .yarn/cache + node_modules + key: ${{ runner.os }}-yarn-${{ hashFiles('**/*.yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Installing dependencies - run: yarn install --immutable-cache + run: yarn install + - name: Testing storybook in production run: yarn dlx nx run ui:storybook:test:production