adding workflow #1
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: Run Nx Tests for V2 | |
on: | |
push: | |
branches: | |
- v2 | |
pull_request: | |
branches: | |
- v2 | |
jobs: | |
nx-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16, 18] # Adjust to the versions your project supports | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache Yarn dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/yarn | |
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn-${{ matrix.node-version }} | |
- name: Install dependencies with Yarn | |
run: yarn install | |
- name: Run Nx Tests | |
run: yarn nx test |