Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

feat(cache-module): implemented cached modules #1349

feat(cache-module): implemented cached modules

feat(cache-module): implemented cached modules #1349

name: "[on PR, Trunk] One App Unit and Lint Tests"
on:
pull_request:
push:
branches:
- main
- 5.x.x
jobs:
one-app-unit-tests:
name: One App Unit and Lint Tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, "^18 < 18.16"]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm install
run: NODE_ENV=development npm ci
- name: npm unit test
run: npm run test:unit
- name: npm lint test
run: npm run test:lint
- name: get target branch name
id: vars
run: |
if [[ "${{github.event_name == 'pull_request'}}" == "true" ]]
then
echo ::set-output name=short_ref::${{github.base_ref}}
else
echo ::set-output name=short_ref::${{github.ref_name}}
fi
- name: npm commit lint
run: npm run test:git-history -- --from origin/${{ steps.vars.outputs.short_ref }}