diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6553c337664..24c57b2d6b0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -46,20 +46,8 @@ jobs: - 6379:6379 steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - - name: Cache dependencies - id: cache - uses: actions/cache@v3 - with: - path: '**/node_modules' - key: ${{ matrix.node }}-${{ runner.os }}-modules-${{ hashFiles('**/pnpm.lock') }} + - name: Setup + uses: ./setup.yml - name: Build CI run: pnpm build-ci @@ -137,20 +125,8 @@ jobs: - 6379:6379 steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - - name: Cache dependencies - id: cache - uses: actions/cache@v3 - with: - path: '**/node_modules' - key: ${{ matrix.node }}-${{ runner.os }}-modules-${{ hashFiles('**/pnpm.lock') }} + - name: Setup + uses: ./setup.yml - name: Build CI run: pnpm build-ci @@ -227,20 +203,8 @@ jobs: - 6379:6379 steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - - name: Cache dependencies - id: cache - uses: actions/cache@v3 - with: - path: '**/node_modules' - key: ${{ matrix.node }}-${{ runner.os }}-modules-${{ hashFiles('**/pnpm.lock') }} + - name: Setup + uses: ./setup.yml - name: Build CI run: pnpm build-ci @@ -279,28 +243,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - - name: Add node-gyp - run: pnpm add -g node-gyp - - - name: Cache dependencies - id: cache - uses: actions/cache@v3 - with: - path: '**/node_modules' - key: ${{ matrix.node }}-${{ runner.os }}-modules-${{ hashFiles('**/pnpm.lock') }} - - - name: Install dependencies - run: pnpm i --ignore-engines + - name: Setup Deep + uses: ./setup-deep.yml - name: Run linter env: @@ -316,33 +260,13 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - - name: Cache dependencies - id: cache - uses: actions/cache@v3 - with: - path: '**/node_modules' - key: ${{ matrix.node }}-${{ runner.os }}-modules-${{ hashFiles('**/pnpm.lock') }} + - name: Setup Deep + uses: ./setup-deep.yml - - name: Add node-gyp - run: pnpm add -g node-gyp - - - name: Install dependencies - run: pnpm --ignore-engines - - - name: Assert pnpm.lock is correct + - name: Assert pnpm-lock.yaml is correct run: | if ! git diff --quiet; then - echo 'You need to update the pnpm.lock file (potentially after running: pnpm add -g node-gyp)' + echo 'You need to update the pnpm-lock.yaml file (potentially after running: pnpm add -g node-gyp)' exit 1 fi @@ -400,20 +324,8 @@ jobs: - 15672:15672 steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - - name: Cache d ependencies - id: cache - uses: actions/cache@v3 - with: - path: '**/node_modules' - key: ${{ matrix.node }}-${{ runner.os }}-modules-${{ hashFiles('**/pnpm.lock') }} + - name: Setup + uses: ./setup.yml - name: Build CI run: NO_WEBPACK=true pnpm build-ci @@ -459,24 +371,12 @@ jobs: ports: - 6379:6379 steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} + - name: Setup + uses: ./setup.yml - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 - - name: Cache dependencies - id: cache - uses: actions/cache@v3 - with: - path: '**/node_modules' - key: ${{ matrix.node }}-${{ runner.os }}-modules-${{ hashFiles('**/pnpm.lock') }} - - name: Build CI run: pnpm add -g node-gyp && pnpm i --ignore-engines @@ -527,20 +427,8 @@ jobs: - 6379:6379 steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - - name: Cache dependencies - id: cache - uses: actions/cache@v3 - with: - path: '**/node_modules' - key: ${{ matrix.node }}-${{ runner.os }}-modules-${{ hashFiles('**/pnpm.lock') }} + - name: Setup + uses: ./setup.yml - name: Build CI run: NO_WEBPACK=true pnpm build-ci diff --git a/.github/workflows/setup-deep.yml b/.github/workflows/setup-deep.yml new file mode 100644 index 00000000000..4f9d008233d --- /dev/null +++ b/.github/workflows/setup-deep.yml @@ -0,0 +1,41 @@ +name: Checkout & Setup Node & Install pnpm & Add node-gyp & Install + +steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ matrix.node }}-${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ matrix.node }}-${{ runner.os }}-pnpm-store- + + - name: Add node-gyp + run: pnpm add -g node-gyp + + - name: Install dependencies + run: pnpm i --ignore-scripts + + + + \ No newline at end of file diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml new file mode 100644 index 00000000000..869cc62f7b4 --- /dev/null +++ b/.github/workflows/setup.yml @@ -0,0 +1,29 @@ +name: Checkout & Setup Node & Install pnpm + +steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ matrix.node }}-${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ matrix.node }}-${{ runner.os }}-pnpm-store- \ No newline at end of file