Skip to content

add nbgl tests workflow #17

add nbgl tests workflow

add nbgl tests workflow #17

Workflow file for this run

name: Run NBGL tests
on:
push:
branches:
- master
- main
- develop
pull_request:
workflow_dispatch:
jobs:
test-access:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
steps:
- name: Display token scopes
run: |
RESPONSE=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com)
SCOPES=$(echo "$RESPONSE")
echo "Token scopes: $SCOPES"
if [[ "$SCOPES" == *"repo"* ]] || [[ "$SCOPES" == *"public_repo"* ]]; then
echo "Token has the necessary permissions."
else
echo "Token does not have the necessary permissions."
exit 1
fi
- name: Test access to app-nbgl repository
run: |
if gh issue list --repo LedgerHQ/app-nbgl-tests; then
echo "Access to the repository tests is successful."
else
echo "Failed to access the repository."
fi
- name: Test access to ledger-secure-sdk repository
run: |
if gh api -X GET /repos/LedgerHQ/app-nbgl-tests; then
echo "Access to the repository is successful."
else
echo "Failed to access the repository."
fi
- name: Trigger the workflow in the target repository2
run: |
gh api -X POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/LedgerHQ/app-nbgl-tests/dispatches \
-f event_type=trigger-workflow \
-f client_payload='{"inputs":{"golden_run":"Open a PR"}}'
run_NBGL_tests:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
steps:
- name: Test access to app-ethereum repository
run: |
if gh issue list --repo LedgerHQ/app-ethereum; then
echo "Access to the repository is successful."
else
echo "Failed to access the repository."
fi
- name: Test access to app-nbgl repository
run: |
if gh issue list --repo LedgerHQ/app-nbgl-tests; then
echo "Access to the repository tests is successful."
else
echo "Failed to access the repository."
fi
- name: Trigger the workflow in the target repository1
run: |
gh api -X POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/LedgerHQ/ledger-secure-sdk/dispatches \
-f event_type=trigger-workflow \
-f client_payload='{"inputs":{"golden_run":"Open a PR"}}'
- name: Trigger the workflow in the target repository21
run: |
gh api -X POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/LedgerHQ/app-ethereum/dispatches \
-f event_type=trigger-workflow \
-f client_payload='{"inputs":{"golden_run":"Open a PR"}}'
- name: Trigger the workflow in the target repository2
run: |
gh api -X POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/LedgerHQ/app-nbgl-tests/dispatches \
-f event_type=trigger-workflow \
-f client_payload='{"inputs":{"golden_run":"Open a PR"}}'
- name: Trigger the NBGL tests
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/LedgerHQ/app-nbgl-tests/dispatches \
-d '{"event_type":"trigger-workflow","client_payload":{"inputs":{"golden_run":"Open a PR"}}}'