@@ -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
0 commit comments