From 8aeb38e2c98e99adab1f28e0bc73b89227dbd8f4 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Fri, 16 Aug 2024 16:07:45 -0400 Subject: [PATCH] Test using a composite action to wrap all the node config --- .github/workflows/js_lint.yaml | 10 +--------- .github/workflows/setup-node.yml | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/setup-node.yml diff --git a/.github/workflows/js_lint.yaml b/.github/workflows/js_lint.yaml index cef5588466e6..a52b327cac64 100644 --- a/.github/workflows/js_lint.yaml +++ b/.github/workflows/js_lint.yaml @@ -14,17 +14,9 @@ concurrency: jobs: client-unit-test: runs-on: ubuntu-latest - strategy: - matrix: - node: [20.16.0] steps: - uses: actions/checkout@v4 - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node}} - cache: 'yarn' - cache-dependency-path: 'client/yarn.lock' + - uses: ./.github/workflows/setup-node.yaml - run: yarn install --frozen-lockfile working-directory: client - name: Run ESLint diff --git a/.github/workflows/setup-node.yml b/.github/workflows/setup-node.yml new file mode 100644 index 000000000000..4d5b8732382b --- /dev/null +++ b/.github/workflows/setup-node.yml @@ -0,0 +1,24 @@ +name: 'Setup Node.js' +description: 'Sets up Node.js and installs dependencies' +inputs: + node-version: + description: 'The Node.js version to use' + required: true + default: '20.16.0' + cache: + description: 'Whether to cache dependencies' + required: false + default: 'yarn' + cache-dependency-path: + description: 'The path to the dependency file to cache' + required: false + default: 'client/yarn.lock' +runs: + using: "composite" + steps: + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node-version }} + cache: ${{ inputs.cache }} + cache-dependency-path: ${{ inputs.cache-dependency-path }} \ No newline at end of file