From 63b446c82bdb021a9c876a8e0c06d2cbf39bbc1e Mon Sep 17 00:00:00 2001 From: Elliot DeNolf Date: Fri, 20 Sep 2024 09:13:52 -0400 Subject: [PATCH] ci: bring back node setup action --- .github/actions/setup/action.yml | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/actions/setup/action.yml diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000000..3a41c01dca --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,48 @@ +name: Setup node and pnpm +description: Configure the Node.js and pnpm versions + +inputs: + node-version: + description: 'The Node.js version to use' + required: true + default: 22.6.2 + pnpm-version: + description: 'The pnpm version to use' + required: true + default: 9.7.1 + +runs: + using: composite + steps: + # https://github.com/actions/virtual-environments/issues/1187 + - name: tune linux network + shell: bash + run: sudo ethtool -K eth0 tx off rx off + + - name: Setup Node@${{ inputs.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node-version }} + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: ${{ inputs.pnpm-version }} + 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: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + pnpm-store- + pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + + - shell: bash + run: pnpm install