-
-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (32 loc) · 1.15 KB
/
ut.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Unit Tests
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
ut-tests:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js version from .nvmrc
id: nvmrc
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Enable Corepack
run: corepack enable
- name: Get Yarn version from package.json
id: yarn_version
run: |
YARN_VERSION=$(jq -r '.packageManager' package.json | grep -o 'yarn@[0-9]*\.[0-9]*\.[0-9]*')
echo "YARN_VERSION=${YARN_VERSION}" >> $GITHUB_ENV
- name: Install correct Yarn version
run: corepack prepare ${{ env.YARN_VERSION }} --activate
- name: Install dependencies
run: yarn install
- name: Execute Unit tests
run: yarn test:ut