This repository has been archived by the owner on May 3, 2024. It is now read-only.
test(actions): test labeler #1812
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.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@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 "short_ref=${{github.base_ref}}" >> $GITHUB_OUTPUT | |
else | |
echo "short_ref=${{github.ref_name}}" >> $GITHUB_OUTPUT | |
fi | |
- name: npm commit lint | |
run: npm run test:git-history -- --from origin/${{ steps.vars.outputs.short_ref }} | |