diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7418fbfb4..c98a3a060 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,8 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/workflows/shared/setup + - name: setup + uses: ./.github/workflows/shared/setup - name: build run: yarn ci:build @@ -30,21 +31,23 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/workflows/shared/setup + - name: setup + uses: ./.github/workflows/shared/setup - name: e2e run: | yarn ci:build yarn ci:e2e - # build-doc: - # runs-on: ubuntu-latest - # needs: build + build-doc: + runs-on: ubuntu-latest + needs: build - # steps: - # - uses: actions/checkout@v4 + steps: + - uses: actions/checkout@v4 - # - uses: ./.github/workflows/shared/setup + - name: setup + uses: ./.github/workflows/shared/setup - # - name: build-doc - # run: yarn ci:build-doc + - name: build + run: yarn ci:build-doc diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index edf035e7b..dc180b414 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,24 +17,13 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-node@v4 + - name: setup + uses: ./.github/workflows/shared/setup with: - node-version: '20' - - - name: data - id: data - run: | - echo "YARN_CACHE_DIR=$(yarn cache dir)" >> $GITHUB_OUTPUT - - - name: yarn cache ro - uses: actions/cache/restore@v4 - with: - key: yarn-${{ hashFiles('yarn.lock') }} - path: ${{ steps.data.outputs.YARN_CACHE_DIR }} + turbo-cache: false - name: build run: | - yarn install --frozen-lockfile yarn ci:version ${{ github.ref_name }} yarn ci:build diff --git a/.github/workflows/shared/setup/action.yml b/.github/workflows/shared/setup/action.yml index e4f38bb58..961e3d006 100644 --- a/.github/workflows/shared/setup/action.yml +++ b/.github/workflows/shared/setup/action.yml @@ -1,5 +1,9 @@ name: setup +inputs: + turbo-cache: + default: True + runs: using: composite @@ -16,35 +20,35 @@ runs: - name: yarn cache uses: actions/cache@v4 - # if: github.ref_name == 'main' + if: ${{ !startsWith(github.ref_name, 'dependabot') }} with: key: yarn-${{ hashFiles('yarn.lock') }} path: ${{ steps.data.outputs.YARN_CACHE_DIR }} - # - name: yarn cache ro - # uses: actions/cache/restore@v4 - # if: github.ref_name != 'main' - # with: - # key: yarn-${{ hashFiles('yarn.lock') }} - # path: ${{ steps.data.outputs.YARN_CACHE_DIR }} + - name: yarn cache ro + uses: actions/cache/restore@v4 + if: ${{ startsWith(github.ref_name, 'dependabot') }} + with: + key: yarn-${{ hashFiles('yarn.lock') }} + path: ${{ steps.data.outputs.YARN_CACHE_DIR }} - name: turbo cache uses: actions/cache@v4 - # if: github.ref_name == 'main' + if: ${{ inputs.turbo-cache && !startsWith(github.ref_name, 'dependabot') }} with: path: .turbo key: turbo-${{ github.sha }} restore-keys: | turbo- - # - name: turbo cache ro - # uses: actions/cache/restore@v4 - # if: github.ref_name != 'main' - # with: - # path: .turbo - # key: turbo-${{ github.sha }} - # restore-keys: | - # turbo- + - name: turbo cache ro + uses: actions/cache/restore@v4 + if: ${{ inputs.turbo-cache && startsWith(github.ref_name, 'dependabot') }} + with: + path: .turbo + key: turbo-${{ github.sha }} + restore-keys: | + turbo- - name: install shell: bash