Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Niloofar / Setup Github actions #4

Niloofar / Setup Github actions

Niloofar / Setup Github actions #4

Workflow file for this run

name: SmartTrader Test Workflow
on: pull_request
jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
steps:
# checkout the repository content to github runner
- name: Checkout
uses: actions/checkout@v3
# setup nodejs environment
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18.x
# cache the dependencies to speed up the build
- name: Cache dependencies
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
# install dependencies
- name: Install dependencies
run: npm i
# build the react app
- name: Build
run: npm run build
# run tests
- name: Run tests
run: npm run test
# deploy the react app to github pages