Skip to content

Commit 3d9be34

Browse files
committed
various script workflows
Signed-off-by: Anas Nashif <[email protected]>
1 parent 9c4971f commit 3d9be34

File tree

7 files changed

+115
-99
lines changed

7 files changed

+115
-99
lines changed

.github/workflows/devicetree_checks.yml

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,38 +34,18 @@ jobs:
3434
steps:
3535
- name: checkout
3636
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37+
3738
- name: Set up Python ${{ matrix.python-version }}
3839
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
3940
with:
4041
python-version: ${{ matrix.python-version }}
41-
- name: cache-pip-linux
42-
if: startsWith(runner.os, 'Linux')
43-
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
44-
with:
45-
path: ~/.cache/pip
46-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
47-
restore-keys: |
48-
${{ runner.os }}-pip-${{ matrix.python-version }}
49-
- name: cache-pip-mac
50-
if: startsWith(runner.os, 'macOS')
51-
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
52-
with:
53-
path: ~/Library/Caches/pip
54-
# Trailing '-' was just to get a different cache name
55-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-
56-
restore-keys: |
57-
${{ runner.os }}-pip-${{ matrix.python-version }}-
58-
- name: cache-pip-win
59-
if: startsWith(runner.os, 'Windows')
60-
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
61-
with:
62-
path: ~\AppData\Local\pip\Cache
63-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
64-
restore-keys: |
65-
${{ runner.os }}-pip-${{ matrix.python-version }}
66-
- name: install python dependencies
42+
cache: pip
43+
cache-dependency-path: scripts/requirements-actions.txt
44+
45+
- name: install-packages
6746
run: |
68-
pip install pytest pyyaml tox
47+
pip install -r scripts/requirements-actions.txt --require-hashes
48+
6949
- name: run tox
7050
working-directory: scripts/dts/python-devicetree
7151
run: |

.github/workflows/scripts_tests.yml

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,37 +37,16 @@ jobs:
3737
ref: ${{ github.event.pull_request.head.sha }}
3838
fetch-depth: 0
3939

40-
- name: Rebase
41-
continue-on-error: true
42-
env:
43-
BASE_REF: ${{ github.base_ref }}
44-
PR_HEAD: ${{ github.event.pull_request.head.sha }}
45-
run: |
46-
git config --global user.email "[email protected]"
47-
git config --global user.name "Github Actions"
48-
rm -fr ".git/rebase-apply"
49-
rm -fr ".git/rebase-merge"
50-
git rebase origin/${BASE_REF}
51-
git clean -f -d
52-
git log --graph --oneline HEAD...${PR_HEAD}
53-
5440
- name: Set up Python ${{ matrix.python-version }}
5541
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
5642
with:
5743
python-version: ${{ matrix.python-version }}
58-
59-
- name: cache-pip-linux
60-
if: startsWith(runner.os, 'Linux')
61-
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
62-
with:
63-
path: ~/.cache/pip
64-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
65-
restore-keys: |
66-
${{ runner.os }}-pip-${{ matrix.python-version }}
44+
cache: pip
45+
cache-dependency-path: scripts/requirements-actions.txt
6746

6847
- name: install-packages
6948
run: |
70-
pip install -r scripts/requirements-base.txt -r scripts/requirements-build-test.txt
49+
pip install -r scripts/requirements-actions.txt --require-hashes
7150
7251
- name: Run pytest
7352
env:

.github/workflows/twister_tests.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,18 @@ jobs:
4040
steps:
4141
- name: checkout
4242
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
43+
4344
- name: Set up Python ${{ matrix.python-version }}
4445
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
4546
with:
4647
python-version: ${{ matrix.python-version }}
47-
- name: cache-pip-linux
48-
if: startsWith(runner.os, 'Linux')
49-
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
50-
with:
51-
path: ~/.cache/pip
52-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
53-
restore-keys: |
54-
${{ runner.os }}-pip-${{ matrix.python-version }}
48+
cache: pip
49+
cache-dependency-path: scripts/requirements-actions.txt
50+
5551
- name: install-packages
5652
run: |
57-
pip install -r scripts/requirements-base.txt -r scripts/requirements-build-test.txt -r scripts/requirements-run-test.txt
53+
pip install -r scripts/requirements-actions.txt --require-hashes
54+
5855
- name: Run pytest for twisterlib
5956
env:
6057
ZEPHYR_BASE: ./

.github/workflows/twister_tests_blackbox.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,12 @@ jobs:
5959
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
6060
with:
6161
python-version: ${{ matrix.python-version }}
62+
cache: pip
63+
cache-dependency-path: scripts/requirements-actions.txt
6264

63-
- name: Go Into Venv
64-
shell: bash
65-
run: |
66-
python3 -m pip install --user virtualenv
67-
python3 -m venv env
68-
source env/bin/activate
69-
echo "$(which python)"
70-
71-
- name: Install Packages
65+
- name: install-packages
7266
run: |
73-
python3 -m pip install -U -r scripts/requirements-base.txt -r scripts/requirements-build-test.txt -r scripts/requirements-run-test.txt
67+
pip install -r scripts/requirements-actions.txt --require-hashes
7468
7569
- name: Run Pytest For Twister Black Box Tests
7670
shell: bash

.github/workflows/west_cmds.yml

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,42 +37,23 @@ jobs:
3737
steps:
3838
- name: checkout
3939
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40+
4041
- name: Set up Python ${{ matrix.python-version }}
4142
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
4243
with:
4344
python-version: ${{ matrix.python-version }}
44-
- name: cache-pip-linux
45-
if: startsWith(runner.os, 'Linux')
46-
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
47-
with:
48-
path: ~/.cache/pip
49-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
50-
restore-keys: |
51-
${{ runner.os }}-pip-${{ matrix.python-version }}
52-
- name: cache-pip-mac
53-
if: startsWith(runner.os, 'macOS')
54-
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
55-
with:
56-
path: ~/Library/Caches/pip
57-
# Trailing '-' was just to get a different cache name
58-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-
59-
restore-keys: |
60-
${{ runner.os }}-pip-${{ matrix.python-version }}-
61-
- name: cache-pip-win
62-
if: startsWith(runner.os, 'Windows')
63-
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
64-
with:
65-
path: ~\AppData\Local\pip\Cache
66-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
67-
restore-keys: |
68-
${{ runner.os }}-pip-${{ matrix.python-version }}
69-
- name: install pytest
45+
cache: pip
46+
cache-dependency-path: scripts/requirements-actions.txt
47+
48+
- name: install-packages
7049
run: |
71-
pip install pytest west pyelftools canopen natsort progress mypy intelhex psutil ply pyserial anytree junitparser
50+
pip install -r scripts/requirements-actions.txt --require-hashes
51+
7252
- name: run pytest-win
7353
if: runner.os == 'Windows'
7454
run: |
7555
python ./scripts/west_commands/run_tests.py
56+
7657
- name: run pytest-mac-linux
7758
if: runner.os != 'Windows'
7859
run: |

scripts/requirements-actions.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@ yamllint
2626
mock
2727
tomli>=1.1.0
2828
exceptiongroup>=1.0.0rc8
29+
pyelftools>=0.29
30+
psutil>=5.6.6
31+
ply>=3.10
32+
anytree
33+
mypy
34+
serial

scripts/requirements-actions.txt

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
#
55
# pip-compile --allow-unsafe --generate-hashes --output-file=requirements-actions.txt requirements-actions.in
66
#
7+
anytree==2.12.1 \
8+
--hash=sha256:244def434ccf31b668ed282954e5d315b4e066c4940b94aff4a7962d85947830 \
9+
--hash=sha256:5ea9e61caf96db1e5b3d0a914378d2cd83c269dfce1fb8242ce96589fa3382f0
10+
# via -r requirements-actions.in
711
astroid==3.3.9 \
812
--hash=sha256:622cc8e3048684aa42c820d9d218978021c3c3d174fb03a9f0d615921744f550 \
913
--hash=sha256:d05bfd0acba96a7bd43e222828b7d9bc1e138aaeb0649707908d3702a9831248
@@ -303,6 +307,10 @@ filelock==3.18.0 \
303307
# via
304308
# tox
305309
# virtualenv
310+
future==1.0.0 \
311+
--hash=sha256:929292d34f5872e70396626ef385ec22355a1fae8ad29e1a734c3e43f9fbc216 \
312+
--hash=sha256:bd2968309307861edae1458a4f8a4f3598c03be43b97521076aebf5d94c07b05
313+
# via serial
306314
gcovr==8.3 \
307315
--hash=sha256:d613a90aeea967b4972fbff69587bf8995ee3cd80df2556983b73141f30642d2 \
308316
--hash=sha256:faa371f9c4a7f78c9800da655107d4f99f04b718d1c0d9f48cafdcbef0049079
@@ -414,6 +422,10 @@ iniconfig==2.1.0 \
414422
--hash=sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7 \
415423
--hash=sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760
416424
# via pytest
425+
iso8601==2.1.0 \
426+
--hash=sha256:6b1d3829ee8921c4301998c909f7829fa9ed3cbdac0d3b16af2d743aed1ba8df \
427+
--hash=sha256:aac4145c4dcb66ad8b648a02830f5e2ff6c24af20f4f482689be402db2429242
428+
# via serial
417429
isort==6.0.1 \
418430
--hash=sha256:1cb5df28dfbc742e490c5e41bad6da41b805b0a8be7bc93cd0fb2a8a890ac450 \
419431
--hash=sha256:2dc5d7f65c9678d94c88dfc29161a320eec67328bc97aad576874cb4be1e9615
@@ -648,6 +660,44 @@ mock==5.2.0 \
648660
--hash=sha256:4e460e818629b4b173f32d08bf30d3af8123afbb8e04bb5707a1fd4799e503f0 \
649661
--hash=sha256:7ba87f72ca0e915175596069dbbcc7c75af7b5e9b9bc107ad6349ede0819982f
650662
# via -r requirements-actions.in
663+
mypy==1.15.0 \
664+
--hash=sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e \
665+
--hash=sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22 \
666+
--hash=sha256:1905f494bfd7d85a23a88c5d97840888a7bd516545fc5aaedff0267e0bb54e2f \
667+
--hash=sha256:1fbb8da62dc352133d7d7ca90ed2fb0e9d42bb1a32724c287d3c76c58cbaa9c2 \
668+
--hash=sha256:2922d42e16d6de288022e5ca321cd0618b238cfc5570e0263e5ba0a77dbef56f \
669+
--hash=sha256:2e2c2e6d3593f6451b18588848e66260ff62ccca522dd231cd4dd59b0160668b \
670+
--hash=sha256:2ee2d57e01a7c35de00f4634ba1bbf015185b219e4dc5909e281016df43f5ee5 \
671+
--hash=sha256:2f2147ab812b75e5b5499b01ade1f4a81489a147c01585cda36019102538615f \
672+
--hash=sha256:404534629d51d3efea5c800ee7c42b72a6554d6c400e6a79eafe15d11341fd43 \
673+
--hash=sha256:5469affef548bd1895d86d3bf10ce2b44e33d86923c29e4d675b3e323437ea3e \
674+
--hash=sha256:5a95fb17c13e29d2d5195869262f8125dfdb5c134dc8d9a9d0aecf7525b10c2c \
675+
--hash=sha256:6983aae8b2f653e098edb77f893f7b6aca69f6cffb19b2cc7443f23cce5f4828 \
676+
--hash=sha256:712e962a6357634fef20412699a3655c610110e01cdaa6180acec7fc9f8513ba \
677+
--hash=sha256:8023ff13985661b50a5928fc7a5ca15f3d1affb41e5f0a9952cb68ef090b31ee \
678+
--hash=sha256:811aeccadfb730024c5d3e326b2fbe9249bb7413553f15499a4050f7c30e801d \
679+
--hash=sha256:8f8722560a14cde92fdb1e31597760dc35f9f5524cce17836c0d22841830fd5b \
680+
--hash=sha256:93faf3fdb04768d44bf28693293f3904bbb555d076b781ad2530214ee53e3445 \
681+
--hash=sha256:973500e0774b85d9689715feeffcc980193086551110fd678ebe1f4342fb7c5e \
682+
--hash=sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13 \
683+
--hash=sha256:98b7b9b9aedb65fe628c62a6dc57f6d5088ef2dfca37903a7d9ee374d03acca5 \
684+
--hash=sha256:aea39e0583d05124836ea645f412e88a5c7d0fd77a6d694b60d9b6b2d9f184fd \
685+
--hash=sha256:b9378e2c00146c44793c98b8d5a61039a048e31f429fb0eb546d93f4b000bedf \
686+
--hash=sha256:baefc32840a9f00babd83251560e0ae1573e2f9d1b067719479bfb0e987c6357 \
687+
--hash=sha256:be68172e9fd9ad8fb876c6389f16d1c1b5f100ffa779f77b1fb2176fcc9ab95b \
688+
--hash=sha256:c43a7682e24b4f576d93072216bf56eeff70d9140241f9edec0c104d0c515036 \
689+
--hash=sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559 \
690+
--hash=sha256:c7be1e46525adfa0d97681432ee9fcd61a3964c2446795714699a998d193f1a3 \
691+
--hash=sha256:c9817fa23833ff189db061e6d2eff49b2f3b6ed9856b4a0a73046e41932d744f \
692+
--hash=sha256:ce436f4c6d218a070048ed6a44c0bbb10cd2cc5e272b29e7845f6a2f57ee4464 \
693+
--hash=sha256:d10d994b41fb3497719bbf866f227b3489048ea4bbbb5015357db306249f7980 \
694+
--hash=sha256:e601a7fa172c2131bff456bb3ee08a88360760d0d2f8cbd7a75a65497e2df078 \
695+
--hash=sha256:f95579473af29ab73a10bada2f9722856792a36ec5af5399b653aa28360290a5
696+
# via -r requirements-actions.in
697+
mypy-extensions==1.0.0 \
698+
--hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \
699+
--hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782
700+
# via mypy
651701
packaging==24.2 \
652702
--hash=sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759 \
653703
--hash=sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f
@@ -673,10 +723,26 @@ pluggy==1.5.0 \
673723
# via
674724
# pytest
675725
# tox
726+
ply==3.11 \
727+
--hash=sha256:00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3 \
728+
--hash=sha256:096f9b8350b65ebd2fd1346b12452efe5b9607f7482813ffca50c22722a807ce
729+
# via -r requirements-actions.in
676730
polib==1.2.0 \
677731
--hash=sha256:1c77ee1b81feb31df9bca258cbc58db1bbb32d10214b173882452c73af06d62d \
678732
--hash=sha256:f3ef94aefed6e183e342a8a269ae1fc4742ba193186ad76f175938621dbfc26b
679733
# via sphinx-lint
734+
psutil==7.0.0 \
735+
--hash=sha256:101d71dc322e3cffd7cea0650b09b3d08b8e7c4109dd6809fe452dfd00e58b25 \
736+
--hash=sha256:1e744154a6580bc968a0195fd25e80432d3afec619daf145b9e5ba16cc1d688e \
737+
--hash=sha256:1fcee592b4c6f146991ca55919ea3d1f8926497a713ed7faaf8225e174581e91 \
738+
--hash=sha256:39db632f6bb862eeccf56660871433e111b6ea58f2caea825571951d4b6aa3da \
739+
--hash=sha256:4b1388a4f6875d7e2aff5c4ca1cc16c545ed41dd8bb596cefea80111db353a34 \
740+
--hash=sha256:4cf3d4eb1aa9b348dec30105c55cd9b7d4629285735a102beb4441e38db90553 \
741+
--hash=sha256:7be9c3eba38beccb6495ea33afd982a44074b78f28c434a1f51cc07fd315c456 \
742+
--hash=sha256:84df4eb63e16849689f76b1ffcb36db7b8de703d1bc1fe41773db487621b6c17 \
743+
--hash=sha256:a5f098451abc2828f7dc6b58d44b532b22f2088f4999a937557b603ce72b1993 \
744+
--hash=sha256:ba3fcef7523064a6c9da440fc4d6bd07da93ac726b5733c29027d7dc95b39d99
745+
# via -r requirements-actions.in
680746
pyasn1==0.6.1 \
681747
--hash=sha256:0d632f46f2ba09143da3a8afe9e33fb6f92fa2320ab7e886e2d0f7672af84629 \
682748
--hash=sha256:6f580d2bdd84365380830acf45550f2511469f673cb4a5ae3857a3170128b034
@@ -685,6 +751,10 @@ pycparser==2.22 \
685751
--hash=sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6 \
686752
--hash=sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc
687753
# via cffi
754+
pyelftools==0.32 \
755+
--hash=sha256:013df952a006db5e138b1edf6d8a68ecc50630adbd0d83a2d41e7f846163d738 \
756+
--hash=sha256:6de90ee7b8263e740c8715a925382d4099b354f29ac48ea40d840cf7aa14ace5
757+
# via -r requirements-actions.in
688758
pygithub==2.6.1 \
689759
--hash=sha256:6f2fa6d076ccae475f9fc392cc6cdbd54db985d4f69b8833a28397de75ed6ca3 \
690760
--hash=sha256:b5c035392991cca63959e9453286b41b54d83bf2de2daa7d7ff7e4312cebf3bf
@@ -794,6 +864,7 @@ pyyaml==6.0.2 \
794864
# via
795865
# -r requirements-actions.in
796866
# awscli
867+
# serial
797868
# west
798869
# yamllint
799870
regex==2024.11.6 \
@@ -976,14 +1047,20 @@ s3transfer==0.11.4 \
9761047
--hash=sha256:559f161658e1cf0a911f45940552c696735f5c74e64362e515f333ebed87d679 \
9771048
--hash=sha256:ac265fa68318763a03bf2dc4f39d5cbd6a9e178d81cc9483ad27da33637e320d
9781049
# via awscli
1050+
serial==0.0.97 \
1051+
--hash=sha256:542150a127ddbf5ed2acc3a6ac4ce807cbcdae3b197acf785bbda6565c94f848 \
1052+
--hash=sha256:e887f06e07e190e39174b694eee6724e3c48bd361be1d97964caef5d5b61c73b
1053+
# via -r requirements-actions.in
9791054
sh==2.2.2 \
9801055
--hash=sha256:653227a7c41a284ec5302173fbc044ee817c7bad5e6e4d8d55741b9aeb9eb65b \
9811056
--hash=sha256:e0b15b4ae8ffcd399bc8ffddcbd770a43c7a70a24b16773fbb34c001ad5d52af
9821057
# via -r requirements-actions.in
9831058
six==1.17.0 \
9841059
--hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 \
9851060
--hash=sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81
986-
# via python-dateutil
1061+
# via
1062+
# anytree
1063+
# python-dateutil
9871064
sphinx-lint==1.0.0 \
9881065
--hash=sha256:6117a0f340b2dc73eadfc57db7531d4477e0929f92a0c1a2f61e6edbc272f0bc \
9891066
--hash=sha256:6eafdb44172ce526f405bf36c713eb246f1340ec2d667e7298e2487ed76decd2
@@ -1033,7 +1110,9 @@ tox==4.24.2 \
10331110
typing-extensions==4.12.2 \
10341111
--hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \
10351112
--hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8
1036-
# via pygithub
1113+
# via
1114+
# mypy
1115+
# pygithub
10371116
unidiff==0.7.5 \
10381117
--hash=sha256:2e5f0162052248946b9f0970a40e9e124236bf86c82b70821143a6fc1dea2574 \
10391118
--hash=sha256:c93bf2265cc1ba2a520e415ab05da587370bc2a3ae9e0414329f54f0c2fc09e8

0 commit comments

Comments
 (0)