Skip to content

Commit

Permalink
[PKD-11]: Add test to CI/CD
Browse files Browse the repository at this point in the history
* [PKD-11]: Add test to CI/CD

* Update yml

* Update yml - to success yarn

* Update yml and update jest

* Update yml - split jobs

* Update yml - add cache

* Update yml - try to fix slow

* Remove watchman

* add --frozen-lockfile

* Update name
  • Loading branch information
eidan66 authored Jul 21, 2024
1 parent d35eebc commit e1c5281
Show file tree
Hide file tree
Showing 5 changed files with 206 additions and 3 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI Workflow

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
install_dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20'

- name: Cache Node Modules
uses: actions/cache@v3
with:
path: |
node_modules
.yarn/cache
key: ${{ runner.os }}-node-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: yarn --frozen-lockfile

run_tests:
runs-on: ubuntu-latest
needs: install_dependencies
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Restore Node Modules Cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Run Tests
run: yarn jest
Binary file modified .yarn/install-state.gz
Binary file not shown.
8 changes: 7 additions & 1 deletion jest.config.js → jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { Config } from 'jest';

module.exports = {
preset: 'react-native',
transform: {
Expand All @@ -9,4 +11,8 @@ module.exports = {
'\\.svg': '<rootDir>/__tests__/__mocks__/svg.js',
},
testPathIgnorePatterns: ['<rootDir>/__tests__/__mocks__/svg.js'],
};
verbose: true,
collectCoverage: true,
coverageReporters: ['json', 'lcov', 'text', 'clover'],
coverageDirectory: 'coverage',
} as Config;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"react-test-renderer": "18.2.0",
"storybook": "^8.1.10",
"ts-jest": "^29.2.2",
"ts-node": "^10.9.2",
"typescript": "5.0.4"
},
"packageManager": "yarn@3.6.4"
Expand Down
143 changes: 141 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2042,6 +2042,15 @@ __metadata:
languageName: node
linkType: hard

"@cspotcode/source-map-support@npm:^0.8.0":
version: 0.8.1
resolution: "@cspotcode/source-map-support@npm:0.8.1"
dependencies:
"@jridgewell/trace-mapping": 0.3.9
checksum: 5718f267085ed8edb3e7ef210137241775e607ee18b77d95aa5bd7514f47f5019aa2d82d96b3bf342ef7aa890a346fa1044532ff7cc3009e7d24fce3ce6200fa
languageName: node
linkType: hard

"@discoveryjs/json-ext@npm:^0.5.3":
version: 0.5.7
resolution: "@discoveryjs/json-ext@npm:0.5.7"
Expand Down Expand Up @@ -2805,7 +2814,7 @@ __metadata:
languageName: node
linkType: hard

"@jridgewell/resolve-uri@npm:^3.1.0":
"@jridgewell/resolve-uri@npm:^3.0.3, @jridgewell/resolve-uri@npm:^3.1.0":
version: 3.1.2
resolution: "@jridgewell/resolve-uri@npm:3.1.2"
checksum: 83b85f72c59d1c080b4cbec0fef84528963a1b5db34e4370fa4bd1e3ff64a0d80e0cee7369d11d73c704e0286fb2865b530acac7a871088fbe92b5edf1000870
Expand Down Expand Up @@ -2836,6 +2845,16 @@ __metadata:
languageName: node
linkType: hard

"@jridgewell/trace-mapping@npm:0.3.9":
version: 0.3.9
resolution: "@jridgewell/trace-mapping@npm:0.3.9"
dependencies:
"@jridgewell/resolve-uri": ^3.0.3
"@jridgewell/sourcemap-codec": ^1.4.10
checksum: d89597752fd88d3f3480845691a05a44bd21faac18e2185b6f436c3b0fd0c5a859fbbd9aaa92050c4052caf325ad3e10e2e1d1b64327517471b7d51babc0ddef
languageName: node
linkType: hard

"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.20, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25":
version: 0.3.25
resolution: "@jridgewell/trace-mapping@npm:0.3.25"
Expand Down Expand Up @@ -6065,6 +6084,34 @@ __metadata:
languageName: node
linkType: hard

"@tsconfig/node10@npm:^1.0.7":
version: 1.0.11
resolution: "@tsconfig/node10@npm:1.0.11"
checksum: 51fe47d55fe1b80ec35e6e5ed30a13665fd3a531945350aa74a14a1e82875fb60b350c2f2a5e72a64831b1b6bc02acb6760c30b3738b54954ec2dea82db7a267
languageName: node
linkType: hard

"@tsconfig/node12@npm:^1.0.7":
version: 1.0.11
resolution: "@tsconfig/node12@npm:1.0.11"
checksum: 5ce29a41b13e7897a58b8e2df11269c5395999e588b9a467386f99d1d26f6c77d1af2719e407621412520ea30517d718d5192a32403b8dfcc163bf33e40a338a
languageName: node
linkType: hard

"@tsconfig/node14@npm:^1.0.0":
version: 1.0.3
resolution: "@tsconfig/node14@npm:1.0.3"
checksum: 19275fe80c4c8d0ad0abed6a96dbf00642e88b220b090418609c4376e1cef81bf16237bf170ad1b341452feddb8115d8dd2e5acdfdea1b27422071163dc9ba9d
languageName: node
linkType: hard

"@tsconfig/node16@npm:^1.0.2":
version: 1.0.4
resolution: "@tsconfig/node16@npm:1.0.4"
checksum: 202319785901f942a6e1e476b872d421baec20cf09f4b266a1854060efbf78cde16a4d256e8bc949d31e6cd9a90f1e8ef8fb06af96a65e98338a2b6b0de0a0ff
languageName: node
linkType: hard

"@types/aria-query@npm:^5.0.1":
version: 5.0.4
resolution: "@types/aria-query@npm:5.0.4"
Expand Down Expand Up @@ -7017,6 +7064,15 @@ __metadata:
languageName: node
linkType: hard

"acorn-walk@npm:^8.1.1":
version: 8.3.3
resolution: "acorn-walk@npm:8.3.3"
dependencies:
acorn: ^8.11.0
checksum: 0f09d351fc30b69b2b9982bf33dc30f3d35a34e030e5f1ed3c49fc4e3814a192bf3101e4c30912a0595410f5e91bb70ddba011ea73398b3ecbfe41c7334c6dd0
languageName: node
linkType: hard

"acorn@npm:^7.4.1":
version: 7.4.1
resolution: "acorn@npm:7.4.1"
Expand All @@ -7026,6 +7082,15 @@ __metadata:
languageName: node
linkType: hard

"acorn@npm:^8.11.0, acorn@npm:^8.4.1":
version: 8.12.1
resolution: "acorn@npm:8.12.1"
bin:
acorn: bin/acorn
checksum: 677880034aee5bdf7434cc2d25b641d7bedb0b5ef47868a78dadabedccf58e1c5457526d9d8249cd253f2df087e081c3fe7d903b448d8e19e5131a3065b83c07
languageName: node
linkType: hard

"acorn@npm:^8.11.3, acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0":
version: 8.12.0
resolution: "acorn@npm:8.12.0"
Expand Down Expand Up @@ -7232,6 +7297,13 @@ __metadata:
languageName: node
linkType: hard

"arg@npm:^4.1.0":
version: 4.1.3
resolution: "arg@npm:4.1.3"
checksum: 544af8dd3f60546d3e4aff084d451b96961d2267d668670199692f8d054f0415d86fc5497d0e641e91546f0aa920e7c29e5250e99fc89f5552a34b5d93b77f43
languageName: node
linkType: hard

"argparse@npm:^1.0.7":
version: 1.0.10
resolution: "argparse@npm:1.0.10"
Expand Down Expand Up @@ -8530,6 +8602,13 @@ __metadata:
languageName: node
linkType: hard

"create-require@npm:^1.1.0":
version: 1.1.1
resolution: "create-require@npm:1.1.1"
checksum: a9a1503d4390d8b59ad86f4607de7870b39cad43d929813599a23714831e81c520bddf61bcdd1f8e30f05fd3a2b71ae8538e946eb2786dc65c2bbc520f692eff
languageName: node
linkType: hard

"cross-fetch@npm:^3.1.5":
version: 3.1.8
resolution: "cross-fetch@npm:3.1.8"
Expand Down Expand Up @@ -9002,6 +9081,13 @@ __metadata:
languageName: node
linkType: hard

"diff@npm:^4.0.1":
version: 4.0.2
resolution: "diff@npm:4.0.2"
checksum: f2c09b0ce4e6b301c221addd83bf3f454c0bc00caa3dd837cf6c127d6edf7223aa2bbe3b688feea110b7f262adbfc845b757c44c8a9f8c0c5b15d8fa9ce9d20d
languageName: node
linkType: hard

"diff@npm:^5.2.0":
version: 5.2.0
resolution: "diff@npm:5.2.0"
Expand Down Expand Up @@ -12873,7 +12959,7 @@ __metadata:
languageName: node
linkType: hard

"make-error@npm:1.x":
"make-error@npm:1.x, make-error@npm:^1.1.1":
version: 1.3.6
resolution: "make-error@npm:1.3.6"
checksum: b86e5e0e25f7f777b77fabd8e2cbf15737972869d852a22b7e73c17623928fccb826d8e46b9951501d3f20e51ad74ba8c59ed584f610526a48f8ccf88aaec402
Expand Down Expand Up @@ -14387,6 +14473,7 @@ __metadata:
react-test-renderer: 18.2.0
storybook: ^8.1.10
ts-jest: ^29.2.2
ts-node: ^10.9.2
typescript: 5.0.4
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -16762,6 +16849,44 @@ __metadata:
languageName: node
linkType: hard

"ts-node@npm:^10.9.2":
version: 10.9.2
resolution: "ts-node@npm:10.9.2"
dependencies:
"@cspotcode/source-map-support": ^0.8.0
"@tsconfig/node10": ^1.0.7
"@tsconfig/node12": ^1.0.7
"@tsconfig/node14": ^1.0.0
"@tsconfig/node16": ^1.0.2
acorn: ^8.4.1
acorn-walk: ^8.1.1
arg: ^4.1.0
create-require: ^1.1.0
diff: ^4.0.1
make-error: ^1.1.1
v8-compile-cache-lib: ^3.0.1
yn: 3.1.1
peerDependencies:
"@swc/core": ">=1.2.50"
"@swc/wasm": ">=1.2.50"
"@types/node": "*"
typescript: ">=2.7"
peerDependenciesMeta:
"@swc/core":
optional: true
"@swc/wasm":
optional: true
bin:
ts-node: dist/bin.js
ts-node-cwd: dist/bin-cwd.js
ts-node-esm: dist/bin-esm.js
ts-node-script: dist/bin-script.js
ts-node-transpile-only: dist/bin-transpile.js
ts-script: dist/bin-script-deprecated.js
checksum: fde256c9073969e234526e2cfead42591b9a2aec5222bac154b0de2fa9e4ceb30efcd717ee8bc785a56f3a119bdd5aa27b333d9dbec94ed254bd26f8944c67ac
languageName: node
linkType: hard

"tsconfig-paths@npm:^4.2.0":
version: 4.2.0
resolution: "tsconfig-paths@npm:4.2.0"
Expand Down Expand Up @@ -17278,6 +17403,13 @@ __metadata:
languageName: node
linkType: hard

"v8-compile-cache-lib@npm:^3.0.1":
version: 3.0.1
resolution: "v8-compile-cache-lib@npm:3.0.1"
checksum: 78089ad549e21bcdbfca10c08850022b22024cdcc2da9b168bcf5a73a6ed7bf01a9cebb9eac28e03cd23a684d81e0502797e88f3ccd27a32aeab1cfc44c39da0
languageName: node
linkType: hard

"v8-to-istanbul@npm:^9.0.1":
version: 9.3.0
resolution: "v8-to-istanbul@npm:9.3.0"
Expand Down Expand Up @@ -17762,6 +17894,13 @@ __metadata:
languageName: node
linkType: hard

"yn@npm:3.1.1":
version: 3.1.1
resolution: "yn@npm:3.1.1"
checksum: 2c487b0e149e746ef48cda9f8bad10fc83693cd69d7f9dcd8be4214e985de33a29c9e24f3c0d6bcf2288427040a8947406ab27f7af67ee9456e6b84854f02dd6
languageName: node
linkType: hard

"yocto-queue@npm:^0.1.0":
version: 0.1.0
resolution: "yocto-queue@npm:0.1.0"
Expand Down

0 comments on commit e1c5281

Please sign in to comment.