Skip to content

Commit

Permalink
fix: Updated the remaining Github actions to use yarn latest
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMachin1997 committed Oct 31, 2024
1 parent 5246ee4 commit 3a2049e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 46 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/greeting-action.yml

This file was deleted.

49 changes: 25 additions & 24 deletions .github/workflows/linting-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a2049e

Please sign in to comment.