Skip to content

Commit

Permalink
Merge branch 'LedgerHQ:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
keiff3r authored Nov 6, 2024
2 parents 5d89e42 + 563e5e4 commit 9a211cc
Show file tree
Hide file tree
Showing 96 changed files with 1,007 additions and 465 deletions.
42 changes: 34 additions & 8 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,50 @@ jobs:
test_dir: tests
speculos_app_branch_name: ${{ github.ref }}

package_and_test_docker_for_nanos:
name: Build and test the Speculos docker for Nano S
uses: ./.github/workflows/reusable_ragger_tests_latest_speculos.yml
with:
app_repository: LedgerHQ/app-boilerplate
app_branch_name: nanos_baseline
test_dir: tests
speculos_app_branch_name: ${{ github.ref }}

deploy_docker:
name: Build and Upload the Speculos docker
runs-on: ubuntu-latest
if: |
github.event_name == 'push' &&
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
needs: [build]
steps:
- name: Clone
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build and publish to GitHub Packages
uses: docker/build-push-action@v1

- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/ledgerhq/speculos
tags: |
type=raw,value=${{ github.sha }}
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to registry
uses: docker/login-action@v2
with:
repository: ledgerhq/speculos
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
tag_with_sha: true
tags: latest

- name: Build and publish to GitHub Packages
uses: docker/build-push-action@v3
with:
push: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
47 changes: 47 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Documentation generation & update

on:
push:
tags:
- '*'
branches:
- develop
- master
pull_request:
branches:
- develop
- master

jobs:
generate:
name: Generate the documentation
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Python dependencies
run: |
pip install -r docs/requirements.txt
- name: Generate the documentation
run: (cd docs && make html)
- name: Upload documentation bundle
uses: actions/upload-artifact@v4
with:
name: documentation
path: docs/build/html/

deploy:
name: Deploy the documentation on Github pages
runs-on: ubuntu-latest
needs: generate
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
steps:
- name: Download documentation bundle
uses: actions/download-artifact@v4
- name: Deploy documentation on pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: documentation/
30 changes: 17 additions & 13 deletions .github/workflows/reusable_ragger_tests_latest_speculos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
app_repository: ${{ inputs.app_repository }}
app_branch_name: ${{ inputs.app_branch_name }}
upload_app_binaries_artifact: "compiled_app_binaries"
upload_app_binaries_artifact: compiled_app_binaries-${{ inputs.app_branch_name }}

build_docker_image:
name: Build Speculos Docker image
Expand All @@ -52,23 +52,27 @@ jobs:
context: .
outputs: type=docker,dest=/tmp/speculos_image.tar
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: speculos_image
name: speculos_image-${{ inputs.app_branch_name }}
path: /tmp/speculos_image.tar

call_get_app_metadata:
name: Retrieve application metadata
uses: LedgerHQ/ledger-app-workflows/.github/workflows/_get_app_metadata.yml@v1
with:
app_repository: ${{ inputs.app_repository }}
app_branch_name: ${{ inputs.app_branch_name }}

ragger_tests:
name: Functional tests with Ragger
runs-on: ubuntu-latest
needs: [build_docker_image, build_application]
needs: [build_docker_image, build_application, call_get_app_metadata]
strategy:
fail-fast: false
matrix:
include:
- device: nanos
- device: nanox
- device: nanosp
- device: stax
device: ${{ fromJSON(needs.call_get_app_metadata.outputs.compatible_devices) }}

steps:
- name: Clone
uses: actions/checkout@v4
Expand All @@ -91,9 +95,9 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: speculos_image
name: speculos_image-${{ inputs.app_branch_name }}
path: /tmp

- name: Load image
Expand All @@ -102,9 +106,9 @@ jobs:
docker image ls -a
- name: Download app binaries
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: "compiled_app_binaries"
name: compiled_app_binaries-${{ inputs.app_branch_name }}
path: ${{ github.workspace }}/app/build

- name: Run and test Speculos docker
Expand Down
Loading

0 comments on commit 9a211cc

Please sign in to comment.