Skip to content

Commit e9a925d

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/development-dependencies-a93e19baa2
2 parents 82c9e5b + de998cf commit e9a925d

7 files changed

Lines changed: 34 additions & 93 deletions

File tree

.github/actions/cf-github-deploy/action.yaml

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

.github/workflows/cf.yaml

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,8 @@ name: Cloud Foundry
33
on:
44
workflow_call:
55
inputs:
6-
cf-api:
7-
description: 'Cloud Foundry API endpoint'
8-
required: false
9-
type: string
10-
cf-org:
11-
description: 'Cloud Foundry organization'
12-
required: false
13-
type: string
14-
cf-space:
15-
description: 'Cloud Foundry space'
16-
required: false
17-
type: string
186
environment:
19-
description: 'Deployment environment name'
20-
required: true
7+
default: Staging
218
type: string
229

2310
workflow_dispatch:
@@ -40,27 +27,22 @@ jobs:
4027
deploy:
4128
runs-on: ubuntu-latest
4229
steps:
43-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v5
4431
with:
4532
submodules: true
46-
- uses: actions/setup-node@v4
33+
- uses: actions/setup-node@v5
4734
with:
4835
node-version: 22
4936
- uses: ./.github/actions/cf-setup
5037
with:
51-
cf-api: ${{ inputs.cf-api || vars.CF_API }}
52-
cf-org: ${{ inputs.cf-org || vars.CF_ORG }}
53-
cf-space: ${{ inputs.cf-space || vars.CF_SPACE }}
38+
cf-api: ${{ vars.CF_API }}
39+
cf-org: ${{ vars.CF_ORG }}
40+
cf-space: ${{ vars.CF_SPACE }}
5441
cf-username: ${{ vars.CF_USERNAME }}
5542
cf-password: ${{ secrets.CF_PASSWORD }}
5643
- run: npm clean-install
5744
- run: npx cds up
5845

59-
- uses: ./.github/actions/cf-github-deploy
60-
with:
61-
app-name: ${{ env.APP_NAME }}
62-
environment: ${{ inputs.environment || 'Staging' }}
63-
6446
- run: cf logs ${{ env.APP_NAME }} --recent
6547
if: always()
6648
- run: cf logs orders-srv --recent
@@ -71,3 +53,13 @@ jobs:
7153
if: always()
7254
- run: cf logs ${{ env.APP_NAME }}-db-deployer --recent
7355
if: always()
56+
57+
- name: Get application URL
58+
id: route
59+
shell: bash
60+
run: |
61+
host=$(cf app "${APP_NAME}" | awk '/routes:/ {print $2}' | sed -E 's#^https?://##; s/,.*$//')
62+
echo "url=https://$host" >> "$GITHUB_OUTPUT"
63+
environment:
64+
name: ${{ inputs.environment || 'Staging' }}
65+
url: ${{ steps.route.outputs.url }}

.github/workflows/release.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,4 @@ jobs:
1919
uses: capire/samples/.github/workflows/cf.yaml@main
2020
secrets: inherit
2121
with:
22-
cf-api: ${{ vars.CF_API_PRODUCTION }}
23-
cf-org: ${{ vars.CF_ORG_PRODUCTION }}
24-
cf-space: ${{ vars.CF_SPACE_PRODUCTION }}
2522
environment: Production

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
matrix:
1919
node-version: [20, 22]
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v5
2222
with:
2323
submodules: true
24-
- uses: actions/setup-node@v4
24+
- uses: actions/setup-node@v5
2525
with:
2626
node-version: ${{ matrix.node-version }}
2727
- run: npm ci

.vscode/launch.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
{
2-
// Use IntelliSense to learn about possible attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
52
"version": "0.2.0",
63
"configurations": [
74
{
8-
"name": "bookshop",
9-
"command": "npx cds watch bookshop",
10-
"type": "node-terminal",
5+
"name": "vscode-jest-tests.v2",
116
"request": "launch",
7+
"type": "node", "runtimeExecutable": "jest",
8+
"experimentalNetworking": "off",
9+
"args": [
10+
"${relativeFile}",
11+
"-i", "--test-timeout", "1e6",
12+
"-t", "${jest.testNamePattern}",
13+
],
1214
"skipFiles": [
1315
"<node_internals>/**",
1416
"**/node_modules/**",
15-
]
17+
"**/express/**",
18+
"**/jasmine/**",
19+
"**/jest/**",
20+
"**/cds/lib/req/cds-context.js",
21+
],
1622
},
1723
]
1824
}

jest.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export default {
2+
transform: {},
23
silent: true
34
}

tests/messaging.test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
const cds = require('@sap/cds')
2-
const { expect } = cds.test.in(__dirname,'..')
2+
const { expect } = cds.test
3+
cds.User.default = cds.User.Privileged // hard core monkey patch
34

45
describe('cap/samples - Messaging', ()=>{
56

67
const _model = '@capire/reviews'
78
const Reviews = 'sap.capire.reviews.Reviews'
8-
beforeAll(()=>{
9-
cds.User.default = cds.User.Privileged // hard core monkey patch
10-
})
119

1210
it ('should bootstrap sqlite in-memory db', async()=>{
1311
const db = await cds.deploy (_model) .to ('sqlite::memory:')

0 commit comments

Comments
 (0)