Skip to content
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
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Fixes
<!-- List the GitHub issue this PR resolves -->
-

## Changes
<!-- List the changes this PR introduces -->
-

## Checklist
<!-- Put an `x` in the boxes. All tasks must be completed and boxes checked before merging. -->
- [ ] 🤖 This change is covered by unit tests (if applicable).
- [ ] 🤹 Manual testing has been performed (if necessary).
- [ ] 🛡️ Security impacts have been considered (if relevant).
- [ ] 📖 Documentation updates are complete (if required).
- [ ] 🧠 Third-party dependencies and TPIP updated (if required).
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2

registries:
npm-github:
type: npm-registry
url: https://npm.pkg.github.com
token: ${{secrets.GH_PACKAGES_TOKEN}}

updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

# Maintain dependencies for the JavaScript package
- package-ecosystem: "npm"
directory: "/"
registries:
- npm-github
schedule:
interval: "weekly"
10 changes: 9 additions & 1 deletion .github/workflows/bridge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
tests:
if: |
Expand All @@ -26,13 +29,18 @@ jobs:
name: 'Test bridge'

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- name: Checkout csolution-rpc repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 'lts/*'

Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
tests:
if: |
Expand All @@ -30,13 +33,18 @@ jobs:
name: 'Test codegen'

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- name: Checkout csolution-rpc repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 'lts/*'

Expand All @@ -59,7 +67,7 @@ jobs:
path: codegen/reports/junit/testreport.xml
retention-days: 1
if-no-files-found: error

- name: Archive generated interface files
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
Expand All @@ -77,6 +85,11 @@ jobs:
contents: write

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- name: Download generated files
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
paths:
- '.github/workflows/codeql.yml'
- 'api/**'
- 'bridge/**'
- 'codegen/**'
- '!**/*.md'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
checks: write
security-events: write

steps:
- name: Harden Runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Initialize CodeQL
uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
with:
languages: TypeScript
queries: security-extended

- name: Autobuild
uses: github/codeql-action/autobuild@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
2 changes: 1 addition & 1 deletion api/csolution-openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.1.0
info:
title: csolution rpc
version: 0.0.1
description: Specification of remote procedure call methods for CMSIS csolution integration
description: Specification of remote procedure call methods for CMSIS csolution integration
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
Expand Down
2 changes: 1 addition & 1 deletion bridge/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
]
}
]
}
}
1 change: 0 additions & 1 deletion bridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ npm run lint
node dist/server.js
```
By default it listens on http://localhost:3000

2 changes: 1 addition & 1 deletion codegen/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
}
}
]
}
}
2 changes: 1 addition & 1 deletion codegen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ Options:
-c, --client <string> Generate TypeScript client interface (default: "./rpc-interface.ts")
-s, --server <string> Generate C++ server interface (default: "./RpcInterface.h")
-h, --help display help for command
```
```
2 changes: 1 addition & 1 deletion codegen/src/codegen.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Codegen} from './codegen.js';
import fs from 'fs';

describe('codegen', () => {
let codegen: Codegen;
let codegen: Codegen;

beforeEach(() => {
codegen = new Codegen();
Expand Down
2 changes: 1 addition & 1 deletion codegen/src/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ using namespace jsonrpccxx;\n`;
this.collectStructs(parent, item);
} else if (item.$ref) {
const ref = item.$ref.match(/^#\/components\/schemas\/(.*)/);
this.structs[parent] ??= { description: obj.description };
this.structs[parent] ??= { description: obj.description };
(this.structs[parent].extends ??= []).push(ref ? ref[1] : '');
}
}
Expand Down
2 changes: 1 addition & 1 deletion csolution-rpc.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
}
],
"settings": {}
}
}