Skip to content

Commit d2310bc

Browse files
ci: remove redundancies and add small fixes
1 parent c2ae3ac commit d2310bc

1 file changed

Lines changed: 25 additions & 31 deletions

File tree

.github/workflows/pr.yml

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches: [develop, main]
66
pull_request:
77

8+
permissions:
9+
contents: read
10+
811
concurrency:
912
group: ${{ github.workflow }}-${{ github.ref }}
1013
cancel-in-progress: true
@@ -22,9 +25,9 @@ jobs:
2225
run:
2326
working-directory: ./etc/scripts
2427
steps:
25-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2629
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
27-
uses: actions/setup-python@v5
30+
uses: actions/setup-python@a26af69be951a213d95a4c3e4e4022e16d87065 # v5
2831
with:
2932
python-version: ${{ env.X_PYTHON_MIN_VERSION }}
3033
cache: "pip"
@@ -76,15 +79,15 @@ jobs:
7679
run:
7780
working-directory: ./sdk
7881
steps:
79-
- uses: actions/checkout@v4
82+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8083
- name: Verify Matrix Version matches Global Version
8184
run: |
8285
if [ "${{ matrix.python-version }}" != "${{ env.X_PYTHON_MIN_VERSION }}" ] && [ "${{ matrix.python-version }}" != "${{ env.X_PYTHON_MAX_VERSION }}" ]; then
8386
echo "Error: Matrix version ${{ matrix.python-version }} does not match global version."
8487
exit 1
8588
fi
8689
- name: Set up Python ${{ matrix.python-version }}
87-
uses: actions/setup-python@v5
90+
uses: actions/setup-python@a26af69be951a213d95a4c3e4e4022e16d87065 # v5
8891
with:
8992
python-version: ${{ matrix.python-version }}
9093
cache: "pip"
@@ -116,9 +119,9 @@ jobs:
116119
run:
117120
working-directory: ./sdk
118121
steps:
119-
- uses: actions/checkout@v4
122+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
120123
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
121-
uses: actions/setup-python@v5
124+
uses: actions/setup-python@a26af69be951a213d95a4c3e4e4022e16d87065 # v5
122125
with:
123126
python-version: ${{ env.X_PYTHON_MIN_VERSION }}
124127
cache: "pip"
@@ -141,9 +144,9 @@ jobs:
141144
run:
142145
working-directory: ./sdk
143146
steps:
144-
- uses: actions/checkout@v4
147+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
145148
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
146-
uses: actions/setup-python@v5
149+
uses: actions/setup-python@a26af69be951a213d95a4c3e4e4022e16d87065 # v5
147150
with:
148151
python-version: ${{ env.X_PYTHON_MIN_VERSION }}
149152
cache: "pip"
@@ -153,7 +156,6 @@ jobs:
153156
python -m pip install --upgrade pip
154157
python -m pip install .[dev]
155158
- name: Check typing with MyPy
156-
shell: bash
157159
run: |
158160
python -m mypy <(python -m codeblocks python README.md)
159161
- name: Check code style with PyCodestyle
@@ -170,9 +172,9 @@ jobs:
170172
run:
171173
working-directory: ./sdk
172174
steps:
173-
- uses: actions/checkout@v4
175+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
174176
- name: Set up Python ${{ env.X_PYTHON_MAX_VERSION }}
175-
uses: actions/setup-python@v5
177+
uses: actions/setup-python@a26af69be951a213d95a4c3e4e4022e16d87065 # v5
176178
with:
177179
python-version: ${{ env.X_PYTHON_MAX_VERSION }}
178180
cache: "pip"
@@ -192,9 +194,9 @@ jobs:
192194
run:
193195
working-directory: ./sdk
194196
steps:
195-
- uses: actions/checkout@v4
197+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
196198
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
197-
uses: actions/setup-python@v5
199+
uses: actions/setup-python@a26af69be951a213d95a4c3e4e4022e16d87065 # v5
198200
with:
199201
python-version: ${{ env.X_PYTHON_MIN_VERSION }}
200202
- name: Install dependencies
@@ -209,13 +211,9 @@ jobs:
209211
# This job checks that the copyright year in the header of all files is up to date
210212
runs-on: ubuntu-latest
211213
steps:
212-
- uses: actions/checkout@v4
214+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
213215
with:
214216
fetch-depth: 0 # Ensure full history is available
215-
- name: Install required dependencies
216-
run: |
217-
sudo apt-get update
218-
sudo apt-get install -y bash git
219217
- name: Run copyright check
220218
run: |
221219
chmod +x ./etc/scripts/set_copyright_year.sh
@@ -232,9 +230,9 @@ jobs:
232230
working-directory: ./compliance_tool
233231

234232
steps:
235-
- uses: actions/checkout@v4
233+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
236234
- name: Set up Python ${{ matrix.python-version }}
237-
uses: actions/setup-python@v5
235+
uses: actions/setup-python@a26af69be951a213d95a4c3e4e4022e16d87065 # v5
238236
with:
239237
python-version: ${{ matrix.python-version }}
240238
cache: "pip"
@@ -261,9 +259,9 @@ jobs:
261259
run:
262260
working-directory: ./compliance_tool
263261
steps:
264-
- uses: actions/checkout@v4
262+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
265263
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
266-
uses: actions/setup-python@v5
264+
uses: actions/setup-python@a26af69be951a213d95a4c3e4e4022e16d87065 # v5
267265
with:
268266
python-version: ${{ env.X_PYTHON_MIN_VERSION }}
269267
cache: "pip"
@@ -289,9 +287,9 @@ jobs:
289287
run:
290288
working-directory: ./compliance_tool
291289
steps:
292-
- uses: actions/checkout@v4
290+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
293291
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
294-
uses: actions/setup-python@v5
292+
uses: actions/setup-python@a26af69be951a213d95a4c3e4e4022e16d87065 # v5
295293
with:
296294
python-version: ${{ env.X_PYTHON_MIN_VERSION }}
297295
- name: Install dependencies
@@ -302,10 +300,6 @@ jobs:
302300
run: |
303301
python -m build
304302
305-
#server-test:
306-
# TODO: This job runs the unittests on the python versions specified down at the matrix
307-
# and aas-test-engines on the server
308-
309303
310304
server-static-analysis:
311305
# This job runs static code analysis, namely pycodestyle and mypy
@@ -315,9 +309,9 @@ jobs:
315309
run:
316310
working-directory: ./server
317311
steps:
318-
- uses: actions/checkout@v4
312+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
319313
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
320-
uses: actions/setup-python@v5
314+
uses: actions/setup-python@a26af69be951a213d95a4c3e4e4022e16d87065 # v5
321315
with:
322316
python-version: ${{ env.X_PYTHON_MIN_VERSION }}
323317
cache: "pip"
@@ -345,7 +339,7 @@ jobs:
345339
run:
346340
working-directory: ./server/docker/${{ matrix.service }}
347341
steps:
348-
- uses: actions/checkout@v4
342+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
349343
- name: Build the Docker image
350344
run: |
351345
docker build -t basyx-python-${{ matrix.service }} -f Dockerfile ../../..

0 commit comments

Comments
 (0)