From cff1eb3d3cea74469bcf3f215fd887f1907d3c8b Mon Sep 17 00:00:00 2001 From: TheAfroOfDoom Date: Sun, 31 Dec 2023 02:32:43 -0500 Subject: [PATCH] move shared workflow code into `install-yarn-dependencies` reusable workflow --- .../workflows/install-yarn-dependencies.yml | 17 ++++++++++++++++ .github/workflows/scripts.yml | 20 ++----------------- 2 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/install-yarn-dependencies.yml diff --git a/.github/workflows/install-yarn-dependencies.yml b/.github/workflows/install-yarn-dependencies.yml new file mode 100644 index 000000000..4507dbf9e --- /dev/null +++ b/.github/workflows/install-yarn-dependencies.yml @@ -0,0 +1,17 @@ +name: install-yarn-dependencies + +on: workflow_call + +jobs: + install-dependencies: + runs-on: ubuntu-latest + steps: + - name: Install Yarn 3.6.3 + run: corepack enable + - name: Setup cache + uses: actions/setup-node@v4 + with: + cache: 'yarn' + cache-dependency-path: yarn.lock + node-version-file: package.json + - run: yarn diff --git a/.github/workflows/scripts.yml b/.github/workflows/scripts.yml index cbc8b2309..d8e969165 100644 --- a/.github/workflows/scripts.yml +++ b/.github/workflows/scripts.yml @@ -7,15 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Yarn 3.6.3 - run: corepack enable - - name: Setup cache - uses: actions/setup-node@v4 - with: - cache: 'yarn' - cache-dependency-path: yarn.lock - node-version-file: package.json - - run: yarn + - uses: ./.github/workflows/install-yarn-dependencies - name: Run Prettier run: yarn start lint.prettier.check @@ -24,14 +16,6 @@ jobs: needs: format steps: - uses: actions/checkout@v4 - - name: Install Yarn 3.6.3 - run: corepack enable - - name: Setup cache - uses: actions/setup-node@v4 - with: - cache: 'yarn' - cache-dependency-path: yarn.lock - node-version-file: package.json - - run: yarn + - uses: ./.github/workflows/install-yarn-dependencies - name: Run ESLint run: yarn start lint.eslint.check