From 3a2049e795360dd58ba9be5bd6448ffcccb27207 Mon Sep 17 00:00:00 2001 From: AlexMachin1997 Date: Thu, 31 Oct 2024 16:30:32 +0000 Subject: [PATCH] fix: Updated the remaining Github actions to use yarn latest --- .github/workflows/greeting-action.yml | 22 ------------ .github/workflows/linting-action.yml | 49 ++++++++++++++------------- 2 files changed, 25 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/greeting-action.yml diff --git a/.github/workflows/greeting-action.yml b/.github/workflows/greeting-action.yml deleted file mode 100644 index 897eb5a..0000000 --- a/.github/workflows/greeting-action.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Job name -name: Greeting first time users - -# When the to run the greeting -on: [pull_request, issues] - -# Jobs to run for the action (You can have multiple actions in one file) -jobs: - greet-user: - # Job display name - name: Greeting Action - - # Runs on a Linux based OS - runs-on: ubuntu-latest - - # Runs the greeting action (Options can be found here https://github.com/actions/first-interaction) - steps: - - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} # Authorizes the github action via a Github token which is for this repo only (Generated automatically) - issue-message: "Looks like this is your first issue' first issue" # Shows when a user fires their first issue - pr-message: "Looks like this is your first PR' first pr" # Shows when a user fires their first PR diff --git a/.github/workflows/linting-action.yml b/.github/workflows/linting-action.yml index 94180c4..e53d516 100644 --- a/.github/workflows/linting-action.yml +++ b/.github/workflows/linting-action.yml @@ -15,41 +15,42 @@ jobs: # Steps involved for this particular task steps: - # Checks out the reporsitoy and enables the use of commands made avaliable in the project ie npm run + # Checks out the repository and enables the use of commands made available in the project ie npm run - name: Check out Git repository uses: actions/checkout@v2 - # Setup Nodes on the versions specified in the matrix stratergy - - name: Set up Node.js version + # Setup Nodes on the versions specified in the matrix strategy + - name: Set up Node.js uses: actions/setup-node@v1 with: - node-version: 12 + node-version: 20.x - # Cache the node_modules - - name: Cache node modules - uses: actions/cache@v2 + # Enable Corepack for Yarn + - name: Enable Corepack + run: corepack enable - # Defining the cache env config ie the key - env: - cache-name: cache-node-modules + # Set Yarn version + - name: Set Yarn version + run: yarn set version 4.2.2 - # Caching options (https://github.com/actions/cache) + # Cache the yarn dependencies + - name: Cache yarn dependencies + uses: actions/cache@v2 + env: + cache-name: cache-yarn-dependencies with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - - # Key for caching the files initally - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - - # Restore keys + path: | + .yarn/cache + .yarn/unplugged + .yarn/build-state.yml + .yarn/install-state.gz + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + ${{ runner.os }}-yarn- - # Installs all the project dependencies e.g. prettier, eslint etc via a custom project script - - name: Install Node.js dependencies - run: npm run allDependencies + # Install dependencies using Yarn + - name: Install dependencies + run: yarn install # Run the linting action - name: Run linters