Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actions to update CDS test branch #49

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/create-test-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Create CDS Test branch

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
name: Build and Push
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Copy xmpls
run: npm run add-all-xmpls

- name: Test
run: |
npm i
npm test

- name: Extract last commit author email and name
id: extract_commit_info
run: |
LAST_COMMIT_EMAIL=$(git log -1 --pretty=format:'%ae')
LAST_COMMIT_NAME=$(git log -1 --pretty=format:'%an')
echo "AUTHOR_EMAIL=$LAST_COMMIT_EMAIL" >> $GITHUB_ENV
echo "AUTHOR_NAME=$LAST_COMMIT_NAME" >> $GITHUB_ENV

- name: Push
run: |
git config --global user.email "${{ env.AUTHOR_EMAIL }}"
git config --global user.name "${{ env.AUTHOR_NAME }}"
# Add and commit changes locally
git add .
git commit -m "${{ github.event.head_commit.message }}"
git push --force-with-lease origin HEAD:cds-test-integrate
5 changes: 5 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm i
- run: npm test

push:
name: Push to CDS Test branch
uses: ./.github/workflows/create-test-branch.yml
if: github.event_name == 'push'
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"clone-add-attachments": "git clone https://github.com/cap-js/attachments.git && cp -r attachments/xmpl/db . && cp -r attachments/xmpl/app . && npm add https://github.com/cap-js/attachments.git",
"add-notifications": "npm add @cap-js/notifications && cp xmpls/alert-notifications.js ./srv && cp xmpls/notification-types.json ./srv",
"add-audit-log": "npm add @cap-js/audit-logging && cp xmpls/data-privacy.cds ./srv && cp xmpls/audit-log.test.js ./test",
"add-remote-service": "cp -r xmpls/remote-service/ .",
"add-messaging": "cp -r xmpls/messaging/ .",
"add-remote-service": "cp -r xmpls/remote-service/* .",
"add-messaging": "cp -r xmpls/messaging/* .",
"add-all-xmpls": "npm run add-remote-service && npm run add-messaging && npm run add-change-tracking && npm run add-audit-log",
"reset": "read -p 'This will irreversibly reset your working directory including ALL files in this git repo. Continue?' -n 1 -r && echo && if [[ $REPLY =~ ^[Yy]$ ]]; then git clean -fd && git reset --hard && npm i; fi"
},
Expand Down
4 changes: 2 additions & 2 deletions xmpls/messaging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"clone-add-attachments": "git clone https://github.com/cap-js/attachments.git && cp -r attachments/xmpl/db . && cp -r attachments/xmpl/app . && npm add https://github.com/cap-js/attachments.git",
"add-notifications": "npm add @cap-js/notifications && cp xmpls/alert-notifications.js ./srv && cp xmpls/notification-types.json ./srv",
"add-audit-log": "npm add @cap-js/audit-logging && cp xmpls/data-privacy.cds ./srv && cp xmpls/audit-log.test.js ./test",
"add-remote-service": "cp -r xmpls/remote-service/ .",
"add-messaging": "cp -r xmpls/messaging/ .",
"add-remote-service": "cp -r xmpls/remote-service/* .",
"add-messaging": "cp -r xmpls/messaging/* .",
"add-all-xmpls": "npm run add-remote-service && npm run add-messaging && npm run add-change-tracking && npm run add-audit-log",
"reset": "read -p 'This will irreversibly reset your working directory including ALL files in this git repo. Continue?' -n 1 -r && echo && if [[ $REPLY =~ ^[Yy]$ ]]; then git clean -fd && git reset --hard && npm i; fi"
},
Expand Down
4 changes: 2 additions & 2 deletions xmpls/remote-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"clone-add-attachments": "git clone https://github.com/cap-js/attachments.git && cp -r attachments/xmpl/db . && cp -r attachments/xmpl/app . && npm add https://github.com/cap-js/attachments.git",
"add-notifications": "npm add @cap-js/notifications && cp xmpls/alert-notifications.js ./srv && cp xmpls/notification-types.json ./srv",
"add-audit-log": "npm add @cap-js/audit-logging && cp xmpls/data-privacy.cds ./srv && cp xmpls/audit-log.test.js ./test",
"add-remote-service": "cp -r xmpls/remote-service/ .",
"add-messaging": "cp -r xmpls/messaging/ .",
"add-remote-service": "cp -r xmpls/remote-service/* .",
"add-messaging": "cp -r xmpls/messaging/* .",
"add-all-xmpls": "npm run add-remote-service && npm run add-messaging && npm run add-change-tracking && npm run add-audit-log",
"reset": "read -p 'This will irreversibly reset your working directory including ALL files in this git repo. Continue?' -n 1 -r && echo && if [[ $REPLY =~ ^[Yy]$ ]]; then git clean -fd && git reset --hard && npm i; fi"
},
Expand Down