-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
315 changed files
with
22,848 additions
and
6,829 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": [ | ||
"@changesets/changelog-github", | ||
{ | ||
"repo": "LedgerHQ/device-sdk-ts" | ||
} | ||
], | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "develop", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
is_running_on_github_actions() { | ||
[ -n "$CI" ] && [ -n "$GITHUB_ACTIONS" ] | ||
} | ||
|
||
run_danger_on_github_actions() { | ||
echo "Script is running within GitHub Actions workflow." | ||
pnpm danger ci --dangerfile danger/dangerfile.ts --failOnErrors | ||
} | ||
|
||
run_danger_on_local() { | ||
echo "Script is running locally." | ||
pnpm danger pr --dangerfile danger/dangerfile.ts https://github.com/LedgerHQ/device-sdk-ts/pull/${1} | ||
} | ||
|
||
if is_running_on_github_actions; then | ||
run_danger_on_github_actions | ||
else | ||
if [ -z "$1" ]; then | ||
echo "Argument PR number is missing" | ||
exit 1 | ||
fi | ||
run_danger_on_local "$1" | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: "Setup Device SDK toolchain" | ||
description: "Composite job to setup the CI tools for Device SDK" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: moonrepo/setup-toolchain@v0 | ||
|
||
- name: Install toolchain | ||
shell: bash | ||
run: proto use | ||
|
||
- name: Get pnpm store directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
shell: bash | ||
run: pnpm install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "monday" | ||
labels: | ||
- "github-actions" | ||
- "dependencies" | ||
reviewers: | ||
- "LedgerHQ/live-devices" | ||
# Maintain dependencies for pnpm | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "sunday" | ||
labels: | ||
- "pnpm" | ||
- "dependencies" | ||
reviewers: | ||
- "LedgerHQ/live-devices" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!-- | ||
Thank you for your contribution! 👍 | ||
Please make sure to read CONTRIBUTING.md if you have not already. Pull Requests that do not comply with the rules will be arbitrarily closed. | ||
--> | ||
|
||
### 📝 Description | ||
|
||
_Replace this text by a clear and concise description of what this pull request is about and why it is needed. Be sure to explain the problem you're addressing and the solution you're proposing._ | ||
_For libraries, you can add a code sample of how to use it._ | ||
_For bugfixes, you can explain the previous behavior and how it was fixed._ | ||
_In case of visual features, please attach screenshots or video recordings to demonstrate the changes._ | ||
|
||
<!-- | ||
| Before | After | | ||
| ------------- | ------------- | | ||
| | | | ||
--> | ||
|
||
### ❓ Context | ||
|
||
- **JIRA or GitHub link**: <!-- Attach the relevant ticket number if applicable. (e.g., [JIRA-123] for Jira or #123 for a Github issue) --> | ||
|
||
### ✅ Checklist | ||
|
||
Pull Requests must pass the CI and be code reviewed. Set as Draft if the PR is not ready. | ||
|
||
- [ ] **Covered by automatic tests.** <!-- if not, please explain. (Feature must be tested / Bugfix must bring non-regression) --> | ||
- [ ] **Impact of the changes:** <!-- Please take some time to list the impact & what specific areas Quality Assurance (QA) should focus on --> | ||
- ... | ||
|
||
--- | ||
|
||
### 🧐 Checklist for the PR Reviewers | ||
|
||
<!-- Please do not edit this if you are the PR author --> | ||
|
||
- [ ] **The code aligns with the requirements** described in the linked JIRA or GitHub issue. | ||
- [ ] **The PR description clearly documents the changes** made and explains any technical trade-offs or design decisions. | ||
- [ ] **There are no undocumented trade-offs**, technical debt, or maintainability issues. | ||
- [ ] **The PR has been tested** thoroughly, and any potential edge cases have been considered and handled. | ||
- [ ] **Any new dependencies** have been justified and documented. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Pull Request | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, edited] | ||
|
||
env: | ||
FORCE_COLOR: "1" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref_name != 'develop' && github.ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
auto-assign: | ||
name: Auto assign | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: toshimaru/[email protected] | ||
|
||
danger: | ||
name: Run Danger check | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup-toolchain-composite | ||
|
||
- name: Danger | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Workaround when using custom runners | ||
# https://github.com/danger/danger-js/issues/1374 | ||
DANGER_GITHUB_API_BASE_URL: "https://api.github.com" | ||
run: ./.github/actions/danger-check.sh | ||
|
||
health-check: | ||
name: Run health check | ||
needs: [danger] | ||
runs-on: device-sdk-4xlarge-linux | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup-toolchain-composite | ||
|
||
- name: health check | ||
run: pnpm health-check | ||
|
||
unit-tests: | ||
name: Run unit tests | ||
needs: [danger] | ||
runs-on: device-sdk-4xlarge-linux | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup-toolchain-composite | ||
|
||
- name: Test | ||
run: pnpm test:coverage -- --max-warnings=0 | ||
|
||
- uses: sonarsource/sonarqube-scan-action@master | ||
env: | ||
SONAR_TOKEN: ${{ secrets.GREEN_SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ secrets.GREEN_SONAR_HOST_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: publish npm packages | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
FORCE_COLOR: "1" | ||
|
||
jobs: | ||
publish: | ||
environment: Production | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup-toolchain-composite | ||
|
||
- name: install dependencies | ||
run: pnpm install | ||
|
||
- name: build libraries | ||
run: pnpm build | ||
|
||
- name: publish | ||
uses: changesets/action@v1 | ||
with: | ||
publish: pnpm release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
NPM_TOKEN: ${{ secrets.NPMJS_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: create release pull request | ||
on: | ||
push: | ||
branches: | ||
- release | ||
|
||
env: | ||
FORCE_COLOR: "1" | ||
|
||
jobs: | ||
version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup-toolchain-composite | ||
|
||
- name: install dependencies | ||
run: pnpm install | ||
|
||
- name: build libraries | ||
run: pnpm build | ||
|
||
- name: create release pull request or publish | ||
uses: changesets/action@v1 | ||
with: | ||
version: pnpm bump | ||
commit: "🔖 (release): versioning packages" | ||
title: "🔖 (release) [NO-ISSUE]: versioning packages" | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node = "20.12.2" | ||
npm = "10.5.2" | ||
pnpm = "9.0.5" |
Oops, something went wrong.