tests: Added unit test for label use-cases #15
This file contains hidden or 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: API CI | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
- tests | |
paths: | |
- "api/**" | |
- ".github/workflows/api-ci.yml" | |
pull_request: | |
branches: | |
- main | |
- develop | |
- tests | |
paths: | |
- "api/**" | |
- ".github/workflows/api-ci.yml" | |
defaults: | |
run: | |
working-directory: ./api | |
jobs: | |
linter: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: npm | |
cache-dependency-path: package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Run linter | |
run: npm run lint | |
unit-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: npm | |
cache-dependency-path: package-lock.json | |
- name: Setup environment variables | |
run: | | |
echo "JWT_SECRET_VERIFY_EMAIL=test-EMAIL-secret" >> $GITHUB_ENV | |
echo "JWT_ACCESS_SECRET=test-ACCESS-secret" >> $GITHUB_ENV | |
echo "JWT_REFRESH_SECRET=test-REFRESH-secret" >> $GITHUB_ENV | |
echo "NODE_ENV=development" >> $GITHUB_ENV | |
- name: install dependencies | |
run: npm ci | |
- name: run unit tests | |
run: npm run test |