Backend Testing #159
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: CI workflow | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Grab Node Version | |
- name: Get Node Version | |
id: node | |
run: | | |
echo "::set-output name=version::$(node -v)" | |
# Grab Node Cache | |
- name: Get Node Modules Cache | |
uses: actions/cache@v3 | |
id: node_modules | |
with: | |
path: | | |
**/node_modules | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }} | |
# ^ If the OS, yarn.lock, Node version doesn't change, this will use the workflow cache | |
# Set up Node Version | |
- name: Setup Node | |
uses: actions/setup-node@v3.1.1 | |
with: | |
node-version: v16.14.2 | |
cache: 'yarn' | |
cache-dependency-path: app/yarn.lock # <- This is needed for some reason, but the file is empty when I open it (Antonio) | |
# Install yarn and npm for frontend | |
- name: Install Frontend Dependencies | |
run: | | |
cd app | |
yarn install # <- yarn manages caching | |
npm install | |
# Print Coverage Report | |
- name: Print Frontend coverage report | |
run: | | |
cd app | |
npm run coverage | |
# Install yarn and npm for backend | |
- name: Install Backend Dependencies | |
run: | | |
cd backend | |
npm install | |
# Print Coverage Report | |
- name: Print Backend coverage report | |
env: | |
MONGO_URI: ${{ secrets.MONGO_URI }} | |
DATABASE_NAME: ${{ secrets.DATABASE_NAME }} | |
run: | | |
cd backend | |
npm run coverage | |