This repository has been archived by the owner on Feb 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from niloofar-deriv/niloo/862ke0juf/setup-ci
Niloofar / Setup Github actions
- Loading branch information
Showing
7 changed files
with
73 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: invalidate_npm_cache | ||
description: Invalidate the Master NPM cache | ||
runs: | ||
using: composite | ||
steps: | ||
- name: save_cache | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: ./node_modules | ||
key: v1-deps-{{ checksum "package-lock.json" }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: npm_install_from_cache | ||
description: Install npm packages from cache | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Cache dependencies | ||
id: cache-node-modules | ||
uses: actions/cache/restore@v3 | ||
with: | ||
key: v1-deps-{{ checksum "package-lock.json" }} | ||
path: node_modules | ||
- name: Install npm dependencies | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: npm install | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: Setup Node | ||
description: Setup Node.js environment | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
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@v4 | ||
# setup nodejs environment | ||
- name: Setup Node.js environment | ||
uses: ./.github/actions/setup_node | ||
# cache the dependencies to speed up the build and then install dependencies | ||
- name: Cache dependencies | ||
uses: ./.github/actions/npm_install_from_cache | ||
# 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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Test for passing the github actions | ||
// TODO should update this test later | ||
import { describe, expect, test } from "vitest"; | ||
import { render, screen } from "@testing-library/react"; | ||
import Loading from ".."; | ||
|
||
describe("Loading component", () => | ||
test("should show loading text", () => { | ||
render(<Loading />); | ||
expect(screen.getByText("loading")).toBeInTheDocument(); | ||
})); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export const getCookiesObject = (cookies) => {}; | ||
export const getCookiesObject = () => {}; | ||
|
||
export const getDataObjFromCookies = (cookies, fields) => {}; | ||
export const getDataObjFromCookies = () => {}; | ||
|
||
export const getDataLink = (data) => {}; | ||
export const getDataLink = () => {}; | ||
|
||
export const getCookiesFields = () => []; |