Skip to content

Commit ec23cc2

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

File tree

8 files changed

+206
-100
lines changed

8 files changed

+206
-100
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/manifest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929

3030
- name: install-packages
3131
run: |
32+
cd zephyrproject/zephyr
3233
pip install -r scripts/requirements-actions.txt --require-hashes
3334
3435
- name: west setup

.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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,14 @@ 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+
pyserial
35+
natsort
36+
canopen
37+
progress
38+
intelhex
39+
tabulate

0 commit comments

Comments
 (0)