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

Fix: watch local modules other bundles, 5.x.x #2323

Fix: watch local modules other bundles, 5.x.x

Fix: watch local modules other bundles, 5.x.x #2323

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]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v4
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 }}