Skip to content

Commit 2a38e4a

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

File tree

6 files changed

+55
-88
lines changed

6 files changed

+55
-88
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/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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ 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

scripts/requirements-actions.txt

Lines changed: 27 additions & 1 deletion
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
@@ -673,10 +677,26 @@ pluggy==1.5.0 \
673677
# via
674678
# pytest
675679
# tox
680+
ply==3.11 \
681+
--hash=sha256:00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3 \
682+
--hash=sha256:096f9b8350b65ebd2fd1346b12452efe5b9607f7482813ffca50c22722a807ce
683+
# via -r requirements-actions.in
676684
polib==1.2.0 \
677685
--hash=sha256:1c77ee1b81feb31df9bca258cbc58db1bbb32d10214b173882452c73af06d62d \
678686
--hash=sha256:f3ef94aefed6e183e342a8a269ae1fc4742ba193186ad76f175938621dbfc26b
679687
# via sphinx-lint
688+
psutil==7.0.0 \
689+
--hash=sha256:101d71dc322e3cffd7cea0650b09b3d08b8e7c4109dd6809fe452dfd00e58b25 \
690+
--hash=sha256:1e744154a6580bc968a0195fd25e80432d3afec619daf145b9e5ba16cc1d688e \
691+
--hash=sha256:1fcee592b4c6f146991ca55919ea3d1f8926497a713ed7faaf8225e174581e91 \
692+
--hash=sha256:39db632f6bb862eeccf56660871433e111b6ea58f2caea825571951d4b6aa3da \
693+
--hash=sha256:4b1388a4f6875d7e2aff5c4ca1cc16c545ed41dd8bb596cefea80111db353a34 \
694+
--hash=sha256:4cf3d4eb1aa9b348dec30105c55cd9b7d4629285735a102beb4441e38db90553 \
695+
--hash=sha256:7be9c3eba38beccb6495ea33afd982a44074b78f28c434a1f51cc07fd315c456 \
696+
--hash=sha256:84df4eb63e16849689f76b1ffcb36db7b8de703d1bc1fe41773db487621b6c17 \
697+
--hash=sha256:a5f098451abc2828f7dc6b58d44b532b22f2088f4999a937557b603ce72b1993 \
698+
--hash=sha256:ba3fcef7523064a6c9da440fc4d6bd07da93ac726b5733c29027d7dc95b39d99
699+
# via -r requirements-actions.in
680700
pyasn1==0.6.1 \
681701
--hash=sha256:0d632f46f2ba09143da3a8afe9e33fb6f92fa2320ab7e886e2d0f7672af84629 \
682702
--hash=sha256:6f580d2bdd84365380830acf45550f2511469f673cb4a5ae3857a3170128b034
@@ -685,6 +705,10 @@ pycparser==2.22 \
685705
--hash=sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6 \
686706
--hash=sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc
687707
# via cffi
708+
pyelftools==0.32 \
709+
--hash=sha256:013df952a006db5e138b1edf6d8a68ecc50630adbd0d83a2d41e7f846163d738 \
710+
--hash=sha256:6de90ee7b8263e740c8715a925382d4099b354f29ac48ea40d840cf7aa14ace5
711+
# via -r requirements-actions.in
688712
pygithub==2.6.1 \
689713
--hash=sha256:6f2fa6d076ccae475f9fc392cc6cdbd54db985d4f69b8833a28397de75ed6ca3 \
690714
--hash=sha256:b5c035392991cca63959e9453286b41b54d83bf2de2daa7d7ff7e4312cebf3bf
@@ -983,7 +1007,9 @@ sh==2.2.2 \
9831007
six==1.17.0 \
9841008
--hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 \
9851009
--hash=sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81
986-
# via python-dateutil
1010+
# via
1011+
# anytree
1012+
# python-dateutil
9871013
sphinx-lint==1.0.0 \
9881014
--hash=sha256:6117a0f340b2dc73eadfc57db7531d4477e0929f92a0c1a2f61e6edbc272f0bc \
9891015
--hash=sha256:6eafdb44172ce526f405bf36c713eb246f1340ec2d667e7298e2487ed76decd2

0 commit comments

Comments
 (0)