Skip to content

Commit 37e5419

Browse files
committed
Use caching mechanism in actions/setup-python
Instead of trying to specify our own caching mechanism, we use the github actions mechanism provided in actions/setup-python Furthermore, do not specify the specific version of macOS, just use 'macos-latest'
1 parent 251879e commit 37e5419

File tree

1 file changed

+10
-40
lines changed

1 file changed

+10
-40
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
uses: actions/setup-python@v5
2424
with:
2525
python-version: '3.x'
26+
cache: pip
2627
- name: Install Build Dependencies
2728
run: |
2829
python -m pip install --upgrade doc2dash setuptools -r doc/requirements.txt
@@ -54,7 +55,7 @@ jobs:
5455
strategy:
5556
fail-fast: false
5657
matrix:
57-
os: [ubuntu-latest, windows-latest, macos-14]
58+
os: [ubuntu-latest, windows-latest, macos-latest]
5859
qt-lib: [pyqt, pyside]
5960
python-version: ["3.10", "3.11", "3.12"]
6061
include:
@@ -77,7 +78,7 @@ jobs:
7778
qt-lib: "pyside"
7879
qt-version: "PySide6-Essentials"
7980
exclude:
80-
- os: macos-14
81+
- os: macos-latest
8182
python-version: "3.10"
8283
qt-lib: "pyside"
8384
steps:
@@ -86,21 +87,8 @@ jobs:
8687
- name: Setup Python ${{ matrix.python-version }}
8788
uses: actions/setup-python@v5
8889
with:
89-
# Semantic version range syntax or exact version of a Python version
9090
python-version: ${{ matrix.python-version }}
9191
cache: pip
92-
- name: Get pip cache dir
93-
id: pip-cache
94-
run: |
95-
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
96-
shell: bash
97-
- name: pip cache
98-
uses: actions/cache@v4
99-
with:
100-
path: ${{ steps.pip-cache.outputs.dir }}
101-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
102-
restore-keys: |
103-
${{ runner.os }}-pip-
10492
- name: "Install Windows-Mesa OpenGL DLL"
10593
if: runner.os == 'Windows'
10694
run: |
@@ -173,7 +161,7 @@ jobs:
173161
strategy:
174162
fail-fast: false
175163
matrix:
176-
os: [ubuntu-latest, windows-latest, macos-14]
164+
os: [ubuntu-latest, windows-latest, macos-latest]
177165
qt-lib: [pyqt, pyside]
178166
include:
179167
- qt-lib: pyqt
@@ -257,6 +245,7 @@ jobs:
257245
uses: actions/setup-python@v5
258246
with:
259247
python-version: '3.12'
248+
cache: pip
260249
- name: Build Wheel
261250
run: |
262251
python -m pip install setuptools wheel
@@ -265,48 +254,29 @@ jobs:
265254
analyze:
266255
name: analyze
267256
runs-on: ubuntu-latest
257+
permissions:
258+
actions: read
259+
contents: read
260+
security-events: write
268261
steps:
269262
- name: Checkout repository
270263
uses: actions/checkout@v4
271264
with:
272-
# We must fetch at least the immediate parents so that if this is
273-
# a pull request then we can checkout the head.
274265
fetch-depth: 2
275266
- name: Setup Python
276267
uses: actions/setup-python@v5
277268
with:
278269
python-version: '3.12'
270+
cache: pip
279271
- name: Install Dependencies
280272
run: |
281273
python -m pip install PyQt5 numpy scipy
282-
283-
# Initializes the CodeQL tools for scanning.
284274
- name: Initialize CodeQL
285275
uses: github/codeql-action/init@v3
286276
with:
287277
languages: 'python'
288-
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
289-
# If you wish to specify custom queries, you can do so here or in a config file.
290-
# By default, queries listed here will override any specified in a config file.
291-
# Prefix the list here with "+" to use these queries and those in the config file.
292278
queries: +security-and-quality
293-
setup-python-dependencies: false
294-
295-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
296-
# If this step fails, then you should remove it and run the build manually (see below)
297279
- name: Autobuild
298280
uses: github/codeql-action/autobuild@v3
299-
300-
# ℹ️ Command-line programs to run using the OS shell.
301-
# 📚 https://git.io/JvXDl
302-
303-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
304-
# and modify them (or add more) to build your code if your project
305-
# uses a compiled language
306-
307-
#- run: |
308-
# make bootstrap
309-
# make release
310-
311281
- name: Perform CodeQL Analysis
312282
uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)