Skip to content

Commit c96a600

Browse files
qunabusequba
andauthored
Setup workflow with private tests repo (#1616)
* Extend CI For private tests * Extend CI For private tests * Extend CI For private tests * Extend CI For private tests * Extend CI For private tests * Extend CI For private tests * Extend CI For private tests * Extend CI For private tests * Extend CI For private tests * Extend CI For private tests * Extend CI For private tests * Extend CI For private tests * Extend CI For private tests * Extend CI For private tests * Extend CI For private tests * Add npm script test:fetch-private * Adjust eslintingore * Adjust test.yml GH workflow * Add performance.yml GH workflow * Setup codecov.yml * Remove Makefile * Bring back removed npm scripts * Update test/README.md * Add setup files for jest and karma * Move codecov.yml to the repository root * Fix typo in eslintignore file --------- Co-authored-by: Kuba Sekowski <kuba.sekowski.dev@gmail.com>
1 parent 7616150 commit c96a600

17 files changed

Lines changed: 280 additions & 131 deletions

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ test/_setupFiles/*.js
1515

1616
# Auto-generated directories
1717
commonjs
18+
coverage
1819
dist
1920
doc
2021
es

.github/workflows/audit.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@ jobs:
2323
name: audit
2424
runs-on: ${{ matrix.os }}
2525
steps:
26-
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
27-
2826
- name: Setup Node.js ${{ matrix.node-version }}
2927
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d # https://github.com/actions/setup-node/releases/tag/v1.4.4
3028
with:
3129
node-version: ${{ matrix.node-version }}
3230

31+
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
32+
3333
- name: Run audit
34-
run: |
35-
npm run audit
34+
run: npm run audit

.github/workflows/build-docs.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,15 @@ jobs:
2323
name: build-docs
2424
runs-on: ${{ matrix.os }}
2525
steps:
26-
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
27-
2826
- name: Setup Node.js ${{ matrix.node-version }}
2927
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d # https://github.com/actions/setup-node/releases/tag/v1.4.4
3028
with:
3129
node-version: ${{ matrix.node-version }}
3230

31+
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
32+
3333
- name: Install dependencies
34-
run: |
35-
npm ci
34+
run: npm ci
3635

3736
- name: Build docs
38-
run: |
39-
npm run docs:build
37+
run: npm run docs:build

.github/workflows/build.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,15 @@ jobs:
2525
install-command: [ i, ci ]
2626
runs-on: ${{ matrix.os }}
2727
steps:
28-
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
29-
3028
- name: Setup Node.js ${{ matrix.node-version }}
3129
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d # https://github.com/actions/setup-node/releases/tag/v1.4.4
3230
with:
3331
node-version: ${{ matrix.node-version }}
3432

33+
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
34+
3535
- name: Install dependencies
36-
run: |
37-
npm ${{ matrix.install-command }}
36+
run: npm ${{ matrix.install-command }}
3837

3938
- name: Build
40-
run: |
41-
npm run bundle-all
39+
run: npm run bundle-all

.github/workflows/lint.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,15 @@ jobs:
2323
name: lint
2424
runs-on: ${{ matrix.os }}
2525
steps:
26-
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
27-
2826
- name: Setup Node.js ${{ matrix.node-version }}
2927
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d # https://github.com/actions/setup-node/releases/tag/v1.4.4
3028
with:
3129
node-version: ${{ matrix.node-version }}
3230

31+
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
32+
3333
- name: Install dependencies
34-
run: |
35-
npm ci
34+
run: npm ci
3635

3736
- name: Run linter
38-
run: |
39-
npm run lint
37+
run: npm run lint

.github/workflows/performance.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Performance
2+
permissions:
3+
contents: read
4+
pull-requests: write
5+
6+
on:
7+
pull_request:
8+
types:
9+
- opened
10+
- reopened
11+
- synchronize # the head branch is updated from the base branch, new commits are pushed to the head branch, or the base branch is changed
12+
13+
jobs:
14+
performance-test:
15+
strategy:
16+
matrix:
17+
node-version: [ '22' ]
18+
os: [ 'ubuntu-latest' ]
19+
name: Test performance
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- name: Setup Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d # https://github.com/actions/setup-node/releases/tag/v1.4.4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
27+
- name: (base) Checkout main repository
28+
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # https://github.com/actions/checkout/releases/tag/v2.3.4
29+
with:
30+
ref: ${{ github.event.pull_request.base.sha }}
31+
32+
- name: Checkout hyperformula-tests repository
33+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
34+
with:
35+
ssh-key: ${{ secrets.DEPLOY_TOKEN }}
36+
repository: handsontable/hyperformula-tests
37+
path: test/hyperformula-tests
38+
39+
- name: Fetch hyperformula-tests and sync branches
40+
run: cd test && ./fetch-tests.sh
41+
42+
- name: (base) Install dependencies
43+
run: npm ci
44+
45+
- name: (base) Run performance tests
46+
run: npm run benchmark:write-to-file base.json
47+
48+
- name: (head) Checkout main repository
49+
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # https://github.com/actions/checkout/releases/tag/v2.3.4
50+
with:
51+
clean: false
52+
53+
- name: (head) Install dependencies
54+
run: npm ci
55+
56+
- name: (head) Run performance tests
57+
run: |
58+
npm run benchmark:write-to-file head.json
59+
60+
- name: Compare the results
61+
run: |
62+
npm run benchmark:compare-benchmarks base.json head.json performance-report.md
63+
64+
- name: Publish a comment - header
65+
uses: marocchino/sticky-pull-request-comment@6804b5ad49d19c10c9ae7cf5057352f7ff333f31 # https://github.com/marocchino/sticky-pull-request-comment/tree/v1.6.0
66+
with:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
message: |
69+
## Performance comparison of head (${{ github.event.pull_request.head.sha }}) vs base (${{ github.event.pull_request.base.sha }})
70+
71+
- name: Publish a comment - performance comparison report
72+
uses: marocchino/sticky-pull-request-comment@6804b5ad49d19c10c9ae7cf5057352f7ff333f31 # https://github.com/marocchino/sticky-pull-request-comment/tree/v1.6.0
73+
with:
74+
append: true
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
path: performance-report.md

.github/workflows/publish.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,18 @@ jobs:
1717
name: publish-docs
1818
runs-on: ${{ matrix.os }}
1919
steps:
20-
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
21-
2220
- name: Setup Node.js ${{ matrix.node-version }}
2321
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d # https://github.com/actions/setup-node/releases/tag/v1.4.4
2422
with:
2523
node-version: ${{ matrix.node-version }}
2624

25+
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
26+
2727
- name: Install dependencies
28-
run: |
29-
npm ci
28+
run: npm ci
3029

3130
- name: Build docs
32-
run: |
33-
npm run docs:build
31+
run: npm run docs:build
3432

3533
- name: Deploy to GH pages
3634
uses: peaceiris/actions-gh-pages@ba0b7df03e25ff29c924be8149041119e9421ea6 # https://github.com/peaceiris/actions-gh-pages/releases/tag/v3.5.6

.github/workflows/test.yml

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,35 @@ jobs:
2323
name: unit-tests
2424
runs-on: ${{ matrix.os }}
2525
steps:
26-
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
27-
2826
- name: Setup Node.js ${{ matrix.node-version }}
2927
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d # https://github.com/actions/setup-node/releases/tag/v1.4.4
3028
with:
3129
node-version: ${{ matrix.node-version }}
3230

31+
- name: Checkout main repository
32+
uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
33+
34+
- name: Checkout hyperformula-tests repository
35+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
36+
with:
37+
ssh-key: ${{ secrets.DEPLOY_TOKEN }}
38+
repository: handsontable/hyperformula-tests
39+
path: test/hyperformula-tests
40+
41+
- name: Fetch hyperformula-tests and sync branches
42+
run: cd test && ./fetch-tests.sh
43+
3344
- name: Install dependencies
34-
run: |
35-
npm ci
45+
run: npm ci
3646

3747
- name: Run tests
38-
run: |
39-
npm run test:ci
48+
run: npm run test:ci -- --coverage
49+
50+
51+
- name: Upload coverage to Codecov
52+
uses: codecov/codecov-action@6004246f47ab62d32be025ce173b241cd84ac58e # https://github.com/codecov/codecov-action/releases/tag/v1.0.13
53+
env:
54+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4055

4156
browser-tests:
4257
strategy:
@@ -46,17 +61,26 @@ jobs:
4661
name: browser-tests
4762
runs-on: ${{ matrix.os }}
4863
steps:
49-
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
50-
5164
- name: Setup Node.js ${{ matrix.node-version }}
5265
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d # https://github.com/actions/setup-node/releases/tag/v1.4.4
5366
with:
5467
node-version: ${{ matrix.node-version }}
5568

69+
- name: Checkout main repository
70+
uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
71+
72+
- name: Checkout hyperformula-tests repository
73+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
74+
with:
75+
ssh-key: ${{ secrets.DEPLOY_TOKEN }}
76+
repository: handsontable/hyperformula-tests
77+
path: test/hyperformula-tests
78+
79+
- name: Fetch hyperformula-tests and sync branches
80+
run: cd test && ./fetch-tests.sh
81+
5682
- name: Install dependencies
57-
run: |
58-
npm ci
83+
run: npm ci
5984

6085
- name: Run tests
61-
run: |
62-
npm run test:browser
86+
run: npm run test:browser

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.idea/
22
.vscode
33
/commonjs/
4+
/coverage/
45
/dist/
56
/doc/
67
/docs/api/
@@ -21,3 +22,5 @@ node_modules/
2122
*.iml
2223
dev*.html
2324
.DS_Store
25+
26+
/test/hyperformula-tests/

Makefile

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)