[add] Reusable workflow to parse all apps manifest & build them all #4
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
name: Code style check | ||
on: | ||
workflow_call: | ||
inputs: | ||
source: | ||
required: true | ||
type: string | ||
version: | ||
required: false | ||
type: number | ||
default: 11 | ||
extensions: | ||
required: false | ||
default: 'h,c,proto' | ||
type: string | ||
jobs: | ||
call_get_app_metadata: | ||
# Call this job to infer the application language (C or Rust) | ||
name: Retrieve application metadata | ||
uses: LedgerHQ/ledger-app-workflows/.github/workflows/_get_app_metadata.yml | ||
job_lint: | ||
name: Lint check | ||
needs: call_get_app_metadata | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest | ||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v4 | ||
- name: Ensure clang-format is customized | ||
if: ${{ needs.call_get_app_metadata.outputs.is_rust == 'false'}} | ||
uses: andstor/file-existence-action@v3 | ||
with: | ||
files: ".clang-format" | ||
- name: Lint check for C app | ||
if: ${{ needs.call_get_app_metadata.outputs.is_rust == 'false'}} | ||
uses: DoozyX/[email protected] | ||
with: | ||
source: ${{ inputs.source }} | ||
extensions: ${{ inputs.extensions }} | ||
clangFormatVersion: ${{ inputs.version }} | ||
- name: Lint check for Rust app | ||
if: ${{ needs.call_get_app_metadata.outputs.is_rust == 'true'}} | ||
run: cargo fmt --all -- --check | ||
working-directory: ${{ inputs.source }} |