Skip to content

Commit

Permalink
updated to parallel processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagarjun Sanji committed Jun 29, 2024
1 parent 582a571 commit ae423a0
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,36 @@ on:
jobs:
setup:
runs-on: ubuntu-latest
outputs:
node-modules-cache-key: ${{ steps.cache.outputs.cache-hit }}
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Cache node_modules and dist
id: cache
- name: Cache repository
id: cache-repo
uses: actions/cache@v4
with:
path: |
node_modules
dist
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
path: .
key: ${{ runner.os }}-repo-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-repo-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci

build:
needs: setup
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v4
- name: Restore cache
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Restore repository cache
uses: actions/cache@v4
with:
path: |
node_modules
dist
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
path: .
key: ${{ runner.os }}-repo-${{ hashFiles('**/package-lock.json') }}
- name: Compile
run: npm run compile
- name: Upload dist to artifact
Expand All @@ -52,17 +49,19 @@ jobs:
retention-days: 1

test:
needs: [setup, build]
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v4
- name: Restore cache
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Restore repository cache
uses: actions/cache@v4
with:
path: |
node_modules
dist
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
path: .
key: ${{ runner.os }}-repo-${{ hashFiles('**/package-lock.json') }}
- name: Install system dependencies
run: |
sudo apt-get update
Expand All @@ -77,10 +76,9 @@ jobs:
retention-days: 1

cleanup:
needs: [setup, build, test]
runs-on: ubuntu-latest
needs: [build, test]
if: always()
steps:
- name: Cleanup
run: |
npm cache clean --force
run: npm cache clean --force

0 comments on commit ae423a0

Please sign in to comment.