FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ci: pin all GitHub Actions to SHA hashes and update versions (#1681) · raqs31/python-kasa@531be84 · GitHub

Repository navigation

Commit 531be84

Browse files
authored
ci: pin all GitHub Actions to SHA hashes and update versions (python-kasa#1681)
Update action versions and pin to full SHA commit hashes. Windows build parallelization is disabled to avoid hung CI.
1 parent 2efdb7b commit 531be84

7 files changed

Lines changed: 52 additions & 33 deletions

File tree

‎.github/actions/setup/action.yaml‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ description: Install uv, configure the system python, and the package dependenci
44
inputs:
55
uv-install-options:
66
default: ""
7-
uv-version:
8-
default: 0.9.16
97
python-version:
108
required: true
119
cache-pre-commit:
@@ -17,16 +15,11 @@ runs:
1715
steps:
1816
- name: Setup uv
1917
id: setup-uv
20-
uses: astral-sh/setup-uv@v7
18+
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
2119
with:
2220
enable-cache: true
23-
24-
- name: Setup Python
25-
id: setup-python
26-
uses: actions/setup-python@v6
27-
with:
21+
version-file: uv.lock
2822
python-version: ${{ inputs.python-version }}
29-
allow-prereleases: true
3023

3124
- name: Install Project Dependencies
3225
id: install-project-dependencies
@@ -44,7 +37,7 @@ runs:
4437
- name: pre-commit Cache
4538
id: pre-commit-cache
4639
if: inputs.cache-pre-commit == 'true'
47-
uses: actions/cache@v4
40+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
4841
with:
4942
path: ~/.cache/pre-commit/
50-
key: cache-${{ inputs.cache-version }}-${{ runner.os }}-${{ runner.arch }}-pre-commit-${{ steps.pre-commit-version.outputs.pre-commit-version }}-python-${{ inputs.python-version }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
43+
key: cache-${{ inputs.cache-version }}-${{ runner.os }}-${{ runner.arch }}-pre-commit-${{ steps.pre-commit-version.outputs.pre-commit-version }}-python-${{ inputs.python-version }}-${{ steps.setup-uv.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}

‎.github/workflows/ci.yml‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ concurrency:
1919
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2020
cancel-in-progress: true
2121

22-
env:
23-
UV_VERSION: 0.9.16
24-
2522
jobs:
2623
lint:
2724
name: Perform Lint Checks
@@ -32,15 +29,14 @@ jobs:
3229
steps:
3330
- name: Checkout Source Files
3431
id: checkout
35-
uses: actions/checkout@v6
32+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3633

3734
- name: Setup Environment
3835
id: setup-environment
3936
uses: ./.github/actions/setup
4037
with:
4138
python-version: ${{ matrix.python-version }}
4239
cache-pre-commit: true
43-
uv-version: ${{ env.UV_VERSION }}
4440
uv-install-options: --all-extras
4541

4642
- name: Run pre-commit Checks
@@ -66,24 +62,27 @@ jobs:
6662
steps:
6763
- name: Checkout Source Files
6864
id: checkout
69-
uses: actions/checkout@v6
65+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
7066

7167
- name: Setup Environment
7268
id: setup-environment
7369
uses: ./.github/actions/setup
7470
with:
7571
python-version: ${{ matrix.python-version }}
76-
uv-version: ${{ env.UV_VERSION }}
7772
uv-install-options: ${{ matrix.extras == true && '--all-extras' || '' }}
7873

7974
- name: Run PyTests with Code Coverage
8075
id: run-pytests-with-code-coverage
8176
shell: bash
8277
run: |
83-
uv run pytest -n auto --cov kasa --cov-report xml
78+
if [[ "${{ runner.os }}" == "Windows" ]]; then
79+
uv run pytest -n0 --cov kasa --cov-report xml
80+
else
81+
uv run pytest -n auto --cov kasa --cov-report xml
82+
fi
8483
8584
- name: Upload Code Coverage to Codecov
8685
id: upload-code-coverage-to-codecov
87-
uses: codecov/codecov-action@v5
86+
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
8887
with:
8988
token: ${{ secrets.CODECOV_TOKEN }}

‎.github/workflows/codeql-analysis.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
analyze:
2525
name: Analyze
2626
runs-on: ubuntu-latest
27+
env:
28+
CODEQL_ACTION_FILE_COVERAGE_ON_PRS: true
2729
permissions:
2830
actions: read
2931
contents: read
@@ -37,14 +39,14 @@ jobs:
3739
steps:
3840
- name: Checkout Source Files
3941
id: checkout
40-
uses: actions/checkout@v6
42+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
4143

4244
- name: Initialize CodeQL
4345
id: init-codeql
44-
uses: github/codeql-action/init@v4
46+
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4
4547
with:
4648
languages: ${{ matrix.language }}
4749

4850
- name: Perform CodeQL Analysis
4951
id: perform-codeql-analysis
50-
uses: github/codeql-action/analyze@v4
52+
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4

‎.github/workflows/publish.yml‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
types: [published]
77

88
env:
9-
UV_VERSION: 0.9.16
109
PYTHON_VERSION: 3.13
1110

1211
jobs:
@@ -18,16 +17,13 @@ jobs:
1817
steps:
1918
- name: Checkout Source Files
2019
id: checkout
21-
uses: actions/checkout@v6
20+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2221

2322
- name: Setup uv
2423
id: setup-uv
25-
uses: astral-sh/setup-uv@v7
26-
27-
- name: Setup Python
28-
id: setup-python
29-
uses: actions/setup-python@v6
24+
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
3025
with:
26+
version-file: uv.lock
3127
python-version: ${{ env.PYTHON_VERSION }}
3228

3329
- name: Build Packages
@@ -37,4 +33,4 @@ jobs:
3733

3834
- name: Publish Release on PyPI
3935
id: publish-release-on-pypi
40-
uses: pypa/gh-action-pypi-publish@release/v1
36+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1

‎.github/workflows/stale.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
- name: Stale Issues and PRs Policy
1515
id: stale-issues-and-prs-policy
16-
uses: actions/stale@v10
16+
uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10
1717
with:
1818
repo-token: ${{ github.token }}
1919
days-before-stale: 90
@@ -46,7 +46,7 @@ jobs:
4646
4747
- name: needs-more-information and waiting-for-reporter Stale Issues Policy
4848
id: specific-stale-issues-policy
49-
uses: actions/stale@v10
49+
uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10
5050
with:
5151
repo-token: ${{ github.token }}
5252
only-labels: "needs-more-information,waiting-for-reporter"

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ dev-dependencies = [
6262
"pytest-xdist>=3.6.1",
6363
"pytest-socket>=0.7.0",
6464
"ruff>=0.9.0",
65+
"uv>=0.11.26",
6566
]
6667

6768

‎uv.lock‎

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL