Skip to content

Commit b32edca

Browse files
authored
add cds-version to matrix (#25)
* add cds-version to matrix * update peer dep * update cds dep * rm input * update package * update action * update sqlite * update sqlite version * next try of action * update dep * update action * update action * update action * update action * update hana action * updata hana version * update action * update version * Revert "update version" This reverts commit f14beea. * update action * add dep * update action * u * u * updates * updates * . * . * update * Revert "update" This reverts commit b3851df. * update * . * . * . * . * . * update action * update action * update release workflow * update version
1 parent 1308f9e commit b32edca

File tree

7 files changed

+43
-19
lines changed

7 files changed

+43
-19
lines changed

.github/actions/integration-tests/action.yml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,30 +48,50 @@ runs:
4848
done
4949
5050
- uses: actions/checkout@v2
51+
5152
- name: Use Node.js ${{ matrix.node-version }}
5253
uses: actions/setup-node@v2
5354
with:
5455
node-version: ${{ matrix.node-version }}
55-
- run: npm i -g @sap/cds-dk
56+
57+
- name: Set CDS version-specific dependencies
5658
shell: bash
57-
- run: npm i
59+
run: |
60+
if [ "${{ matrix.cds-version }}" == "8" ]; then
61+
echo "Installing CDS 8 compatible packages..."
62+
npm pkg set "devDependencies.@cap-js/sqlite=^1.0.0"
63+
npm pkg set "overrides.@cap-js/sqlite=^1.0.0"
64+
npm pkg set "overrides.@cap-js/hana=^1.0.0"
65+
npm pkg set "overrides.@cap-js/db-service=^1.0.0"
66+
cd test/incidents-app
67+
npm pkg set "dependencies.@cap-js/hana=^1.0.0"
68+
npm pkg set "dependencies.@cap-js/db-service=^1.0.0"
69+
cd ../..
70+
fi
71+
72+
- name: Install global CDS
5873
shell: bash
59-
- run: cd test/incidents-app && npm i
74+
run: npm i -g @sap/cds-dk@${{ matrix.cds-version }}
75+
76+
- name: Install root dependencies
6077
shell: bash
78+
run: |
79+
npm install @sap/cds@${{ matrix.cds-version }}
80+
npm install
6181
6282
- name: Set node env for HANA
6383
run: echo "NODE_VERSION_HANA=$(echo ${{ inputs.NODE_VERSION }} | tr . _)" >> $GITHUB_ENV
6484
shell: bash
6585
# Deploy model to HANA
6686
- name: Create HDI Container
6787
shell: bash
68-
run: cf create-service hana hdi-shared cap-js-print-hana-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-$NODE_VERSION_HANA
69-
- run: cd test/incidents-app/ && cds deploy --to hana:cap-js-print-hana-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-$NODE_VERSION_HANA
88+
run: cf create-service hana hdi-shared cap-js-print-hana-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-$NODE_VERSION_HANA-${{ matrix.cds-version }}
89+
- run: cd test/incidents-app/ && cds deploy --to hana:cap-js-print-hana-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-$NODE_VERSION_HANA-${{ matrix.cds-version }}
7090
shell: bash
7191
# Bind against BTP services
72-
- run: cds bind db -2 cap-js-print-hana-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-$NODE_VERSION_HANA -o package.json
92+
- run: cds bind db -2 cap-js-print-hana-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-$NODE_VERSION_HANA-${{ matrix.cds-version }} -o package.json
7393
shell: bash
74-
- run: cds bind -2 print-service -o package.json
94+
- run: cds bind print-service -2 print-service -o package.json
7595
shell: bash
7696
# Run tests in hybrid mode
7797
- run: cds bind --exec npm run test
@@ -80,15 +100,15 @@ runs:
80100
# Cleanup
81101
- name: Delete HDI Container Key
82102
if: ${{ always() }}
83-
run: cf delete-service-key cap-js-print-hana-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-$NODE_VERSION_HANA cap-js-print-hana-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-$NODE_VERSION_HANA-key -f
103+
run: cf delete-service-key cap-js-print-hana-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-$NODE_VERSION_HANA-${{ matrix.cds-version }} cap-js-print-hana-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-$NODE_VERSION_HANA-${{ matrix.cds-version }}-key -f
84104
shell: bash
85105
# Somehow first delete always fails with a "ongoing operation on service binding" error
86106
- name: Delete HDI Container
87107
if: ${{ always() }}
88108
shell: bash
89109
run: |
90110
for i in {1..3}; do
91-
cf delete-service cap-js-print-hana-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-$NODE_VERSION_HANA -f && break
111+
cf delete-service cap-js-print-hana-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-$NODE_VERSION_HANA-${{ matrix.cds-version }} -f && break
92112
echo "HDI container delete failed, retrying ($i/3)..."
93113
sleep 10
94114
if [ "$i" -eq 3 ]; then

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run: |
2222
npm install
2323
npm run lint
24-
cd tests/incidents-app && npm install
24+
cd test/incidents-app && npm install
2525
cd ../..
2626
npm run test
2727

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
node-version: [20.x, 22.x]
17-
cds-version: [latest]
17+
cds-version: [latest, 8]
1818
steps:
1919
- uses: actions/checkout@v2
2020
- name: Use Node.js ${{ matrix.node-version }}
@@ -31,6 +31,7 @@ jobs:
3131
fail-fast: false
3232
matrix:
3333
node-version: [20.x, 22.x]
34+
cds-version: [latest, 8]
3435
steps:
3536
- name: Checkout repository
3637
uses: actions/checkout@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ mta_archives/
3535

3636
# @cap-js/cds-typer
3737
@cds-models
38+
39+
package-lock.json

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const config = {
2-
testTimeout: 60000,
2+
testTimeout: 120000,
33
testMatch: ["**/*.test.js"],
44
forceExit: true,
55
detectOpenHandles: true,

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cap-js/print",
3-
"version": "1.0.0",
3+
"version": "0.1.0",
44
"description": "CAP plugin for SAP Cloud Print Service.",
55
"repository": "@cap-js/print",
66
"homepage": "https://cap.cloud.sap/",
@@ -26,12 +26,15 @@
2626
"@sap/xssec": "^3.6.2"
2727
},
2828
"peerDependencies": {
29-
"@sap/cds": ">=9"
29+
"@sap/cds": ">= 8"
3030
},
3131
"devDependencies": {
3232
"@cap-js/cds-test": "^0.2.0",
3333
"@cap-js/sqlite": "^2"
3434
},
35+
"workspaces": [
36+
"test/incidents-app/"
37+
],
3538
"cds": {
3639
"requires": {
3740
"destinations": true,
@@ -69,8 +72,5 @@
6972
"prettier:check": "npx -y prettier@3 --check .",
7073
"watch-sample": "cd test/incidents-app && cds watch",
7174
"watch-sample:hybrid": "cd test/incidents-app && cds watch --profile hybrid"
72-
},
73-
"workspaces": [
74-
"test/incidents-app/"
75-
]
75+
}
7676
}

test/incidents-app/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "@capire/incidents",
33
"version": "1.0.0",
44
"dependencies": {
5-
"@cap-js/hana": "*",
5+
"@cap-js/hana": "^2.0.0",
6+
"@cap-js/db-service": "^2.0.0",
67
"@cap-js/print": "file:../../."
78
},
89
"scripts": {

0 commit comments

Comments
 (0)