From 84bec904caef9f135f70183d6b42834a09746d4e Mon Sep 17 00:00:00 2001 From: shayan khaleghparast Date: Mon, 25 Mar 2024 15:02:01 +0800 Subject: [PATCH 1/5] ci: added test step in workflows --- .github/workflows/publish_npm_package.yml | 2 ++ .github/workflows/test_workflow.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/publish_npm_package.yml b/.github/workflows/publish_npm_package.yml index a78898bd..a3d6a90c 100644 --- a/.github/workflows/publish_npm_package.yml +++ b/.github/workflows/publish_npm_package.yml @@ -35,6 +35,8 @@ jobs: run: npm audit signatures - name: Prepublish run: npm run prepublish + - name: Run tests and generate coverage report + run: npm run test:report - name: Release if: success() env: diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index 6692758f..3f1e0221 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -34,3 +34,5 @@ jobs: run: npm run prepublish - name: Build Storybook run: npm run build-storybook + - name: Run tests and generate coverage report + run: npm run test:report From 10beafa434de869d6725984af2c7eaa8aa8516c7 Mon Sep 17 00:00:00 2001 From: shayan khaleghparast Date: Mon, 25 Mar 2024 15:25:27 +0800 Subject: [PATCH 2/5] ci: added coveralls workflow --- .github/workflows/coveralls.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/coveralls.yml diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml new file mode 100644 index 00000000..34dbf7ce --- /dev/null +++ b/.github/workflows/coveralls.yml @@ -0,0 +1,32 @@ +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, edited] +name: Coveralls +jobs: + build: + name: Reporter + runs-on: Runner_8cores_Deriv-app + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - name: Setup Node.js + uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 + with: + node-version: '20' + - name: Update to latest npm (temporary fix for audit below) + run: npm install --global npm + - name: Install dependencies + run: npm clean-install + - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies + run: npm audit signatures + - name: Prepublish + run: npm run prepublish + - name: Build Storybook + run: npm run build-storybook + - name: Test + run: JEST_MAX_WORKERS=95% npm run test:report + - name: Coveralls + uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 From cd8c50a60bf10ffc06362869ae6c9e74526b9129 Mon Sep 17 00:00:00 2001 From: shayan khaleghparast Date: Mon, 25 Mar 2024 15:33:54 +0800 Subject: [PATCH 3/5] ci: fixing ci issues --- .github/workflows/coveralls.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml index 34dbf7ce..58b06531 100644 --- a/.github/workflows/coveralls.yml +++ b/.github/workflows/coveralls.yml @@ -8,7 +8,7 @@ name: Coveralls jobs: build: name: Reporter - runs-on: Runner_8cores_Deriv-app + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 From 99fcb7337a1dd60d9983a3cd2462da49203f3e39 Mon Sep 17 00:00:00 2001 From: shayan khaleghparast Date: Tue, 26 Mar 2024 12:20:57 +0800 Subject: [PATCH 4/5] ci: fix coverall not commenting on pr --- .github/workflows/coveralls.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml index 58b06531..1c1d0eff 100644 --- a/.github/workflows/coveralls.yml +++ b/.github/workflows/coveralls.yml @@ -27,6 +27,6 @@ jobs: - name: Build Storybook run: npm run build-storybook - name: Test - run: JEST_MAX_WORKERS=95% npm run test:report + run: JEST_MAX_WORKERS=95% npm run test -- --collectCoverage - name: Coveralls uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 From e205fe6b4970574133deb3c6be439f57cd6b9819 Mon Sep 17 00:00:00 2001 From: shayan khaleghparast Date: Tue, 26 Mar 2024 12:26:39 +0800 Subject: [PATCH 5/5] chore: reverted the test report command changes --- .github/workflows/coveralls.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml index 1c1d0eff..58b06531 100644 --- a/.github/workflows/coveralls.yml +++ b/.github/workflows/coveralls.yml @@ -27,6 +27,6 @@ jobs: - name: Build Storybook run: npm run build-storybook - name: Test - run: JEST_MAX_WORKERS=95% npm run test -- --collectCoverage + run: JEST_MAX_WORKERS=95% npm run test:report - name: Coveralls uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949