Skip to content

Commit

Permalink
Add first version of app-params database and checker
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Chapron committed Apr 13, 2023
1 parent 9302b19 commit bf16d97
Show file tree
Hide file tree
Showing 7 changed files with 1,718 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/_check_app_params.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Check APP_LOAD_PARAMS

on:
workflow_call:
inputs:
ledger-app-workflows_ref:
description: 'The current reference in use for the ledger-app-workflow repository'
required: true
type: string
download_manifest_artifact_name:
description: 'The name of the artifact containing the built manifest'
required: true
type: string

jobs:
check_app_paramss:
name: Check APP_LOAD_PARAMS
runs-on: ubuntu-latest

steps:
- name: Clone workflows repository
uses: actions/checkout@v3
with:
repository: LedgerHQ/ledger-app-workflows
path: ./ledger-app-workflows
ref: ${{ inputs.ledger-app-workflows_ref }}

- name: Download manifest
uses: actions/download-artifact@v3
with:
name: ${{ inputs.download_manifest_artifact_name }}
path: ${{ inputs.download_manifest_artifact_name }}

- name: Download app params database
run: curl https://raw.githubusercontent.com/LedgerHQ/ledger-app-workflows/xch/app-params-check/app-params-database.json > app-params-database.json

- name: Run script
run: |
python3 ./ledger-app-workflows/scripts/makefile_app_params_check.py \
--database_path app-params-database.json \
--app_manifests_path ${{ inputs.download_manifest_artifact_name }}
23 changes: 23 additions & 0 deletions .github/workflows/database_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Database lint CI

on:
workflow_dispatch:
push:
branches:
- master
- main
- develop
pull_request:

jobs:
database_lint:
name: Database lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Run JQ check
run: jq -e . app-params-database.json >/dev/null

- name: Run linting check
run: scripts/gen_database.py --database_path app-params-database.json --check_lint
8 changes: 8 additions & 0 deletions .github/workflows/reusable_guidelines_enforcer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ jobs:
download_manifest_artifact_name: manifests
ledger-app-workflows_ref: ${{ needs.call_get_workflow_version.outputs.version }}

call_check_app_params:
name: Dispatch check
needs: [call_get_workflow_version, call_get_app_manifest]
uses: ./.github/workflows/_check_app_params.yml
with:
download_manifest_artifact_name: manifests
ledger-app-workflows_ref: ${{ needs.call_get_workflow_version.outputs.version }}

call_check_makefile:
name: Dispatch check
needs: call_get_workflow_version
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/scripts_checking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ jobs:
with:
builtin: clear,rare
check_filenames: true
exclude_file: app-params-database.json
Loading

0 comments on commit bf16d97

Please sign in to comment.