Skip to content

Commit 77947fe

Browse files
update pinned action dependcies to latest versions and seperate linting job to run before tests
1 parent 38c6a28 commit 77947fe

4 files changed

Lines changed: 186 additions & 149 deletions

File tree

.github/workflows/lint.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- "**"
10+
workflow_call:
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
isort:
17+
name: Check import sorting (isort)
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
21+
with:
22+
persist-credentials: false
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
26+
with:
27+
python-version: "3.10"
28+
cache: "pip"
29+
cache-dependency-path: requirements.txt
30+
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install -r requirements.txt
35+
36+
- name: Run isort
37+
run: pre-commit run -a isort
38+
39+
black:
40+
name: Check code formatting (black)
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
44+
with:
45+
persist-credentials: false
46+
47+
- name: Set up Python
48+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
49+
with:
50+
python-version: "3.10"
51+
cache: "pip"
52+
cache-dependency-path: requirements.txt
53+
54+
- name: Install dependencies
55+
run: |
56+
python -m pip install --upgrade pip
57+
pip install -r requirements.txt
58+
59+
- name: Run black
60+
run: pre-commit run -a black
61+
62+
flake8:
63+
name: Check code style (flake8)
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
67+
with:
68+
persist-credentials: false
69+
70+
- name: Set up Python
71+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
72+
with:
73+
python-version: "3.10"
74+
cache: "pip"
75+
cache-dependency-path: requirements.txt
76+
77+
- name: Install dependencies
78+
run: |
79+
python -m pip install --upgrade pip
80+
pip install -r requirements.txt
81+
82+
- name: Run flake8
83+
run: pre-commit run -a flake8
84+
85+
pyupgrade:
86+
name: Check for Python upgrades (pyupgrade)
87+
runs-on: ubuntu-latest
88+
steps:
89+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
90+
with:
91+
persist-credentials: false
92+
93+
- name: Set up Python
94+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
95+
with:
96+
python-version: "3.10"
97+
cache: "pip"
98+
cache-dependency-path: requirements.txt
99+
100+
- name: Install dependencies
101+
run: |
102+
python -m pip install --upgrade pip
103+
pip install -r requirements.txt
104+
105+
- name: Run pyupgrade
106+
run: pre-commit run -a pyupgrade
107+
108+
pylint:
109+
name: Run comprehensive linting (pylint)
110+
runs-on: ubuntu-latest
111+
steps:
112+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
113+
with:
114+
persist-credentials: false
115+
116+
- name: Set up Python
117+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
118+
with:
119+
python-version: "3.10"
120+
cache: "pip"
121+
cache-dependency-path: requirements.txt
122+
123+
- name: Install dependencies
124+
run: |
125+
python -m pip install --upgrade pip
126+
pip install -r requirements.txt
127+
128+
- name: Run pylint
129+
run: pylint --rcfile=.pylintrc cloudsmith_cli

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
CLOUDSMITH_SVC_SLUG: ${{ vars.CLOUDSMITH_SVC_SLUG }}
1919
DOCKERHUB_USER: ${{ vars.DOCKERHUB_USER }}
2020
steps:
21-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2222
with:
2323
persist-credentials: false
2424

2525
- name: Set up Python 3.10
26-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
26+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
2727
with:
2828
python-version: '3.10'
2929

@@ -75,7 +75,7 @@ jobs:
7575
--complete-platform .github/.platforms/windows-x86_64-py314.json
7676
7777
- name: Create Release and Upload Asset
78-
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
78+
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
7979
with:
8080
name: Release v${{ env.VERSION }}
8181
files: ./cloudsmith-${{ env.VERSION }}.pyz
@@ -102,10 +102,10 @@ jobs:
102102
run: cloudsmith push python "${CLOUDSMITH_NAMESPACE}/cli" "dist/cloudsmith_cli-${VERSION}-py3-none-any.whl"
103103

104104
- name: Set up QEMU for multi-arch
105-
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
105+
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
106106

107107
- name: Set up Docker Buildx
108-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
108+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
109109

110110
- name: Push Dockerised CLI to Cloudsmith (multi-arch)
111111
id: push_dockerised_cli_cloudsmith
@@ -137,12 +137,12 @@ jobs:
137137
id-token: write
138138
contents: read
139139
steps:
140-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
140+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
141141
with:
142142
persist-credentials: false
143143

144144
- name: Set up Python 3.10
145-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
145+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
146146
with:
147147
python-version: '3.10'
148148

0 commit comments

Comments
 (0)