-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathcontinuous-integration-workflow.yml
More file actions
114 lines (103 loc) · 3.05 KB
/
continuous-integration-workflow.yml
File metadata and controls
114 lines (103 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Continuous Integration & Deployment
on:
workflow_dispatch:
push:
tags:
- '*'
branches:
- master
pull_request:
branches:
- master
# Cancel previous runs on this reference
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PYGAME_HIDE_SUPPORT_PROMPT: 1
jobs:
coverage:
name: Code coverage
runs-on: ubuntu-latest
container:
image: docker://ghcr.io/ledgerhq/speculos-builder:latest
steps:
- name: Clone
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build with code coverage instrumentation
env:
CTEST_OUTPUT_ON_FAILURE: 1
RNG_SEED: 0
run: |
cmake -Bbuild -H. -DPRECOMPILED_DEPENDENCIES_DIR=/install -DWITH_VNC=1 -DCODE_COVERAGE=ON
make -C build clean
make -C build
make -C build test
pip install pytest-cov
pip install .
PYTHONPATH=. pytest --cov=speculos --cov-report=xml
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
name: codecov-speculos
build:
name: Clone, build, test
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python_version: ['3.10', '3.11', '3.12', '3.13']
# Use https://ghcr.io/ledgerhq/speculos-builder which has all the required
# dependencies
container:
image: docker://ghcr.io/ledgerhq/speculos-builder:latest
steps:
- name: Clone
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python version
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Build and install package
run: |
cmake -Bbuild -H. -DPRECOMPILED_DEPENDENCIES_DIR=/install -DWITH_VNC=1
make -C build
pip install pytest
pip install .
- name: Test
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: |
make -C build/ test
pytest
deploy:
name: Build and deploy speculos package
needs: build
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_pypi_deployment.yml@v1
with:
package_name: speculos
jfrog_deployment: true
release: ${{ startsWith(github.ref, 'refs/tags/') }}
publish: ${{ startsWith(github.ref, 'refs/tags/') }}
container: ghcr.io/ledgerhq/speculos-builder:latest
secrets:
pypi_token: ${{ secrets.PYPI_PUBLIC_API_TOKEN }}
package_and_test_docker:
name: Build and test the Speculos docker
uses: ./.github/workflows/reusable_ragger_tests_latest_speculos.yml
with:
app_repository: LedgerHQ/app-boilerplate
app_branch_name: master
package_and_test_docker_rust:
name: Build and test the Speculos docker with a Rust app
uses: ./.github/workflows/reusable_ragger_tests_latest_speculos.yml
with:
app_repository: LedgerHQ/app-boilerplate-rust
app_branch_name: main