Skip to content

Commit 88b510e

Browse files
committed
Merge remote-tracking branch 'origin/lelia/improve-workflow-pipelines' into lelia/fix-dependabot-checks
# Conflicts: # .github/workflows/docker-stable.yml # .github/workflows/pr-preview.yml # .github/workflows/release.yml
2 parents cb7bc9f + 6f89e0f commit 88b510e

4 files changed

Lines changed: 34 additions & 14 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "Set up Hatch build tooling"
2+
description: >-
3+
Install the pinned hatch / hatchling / virtualenv toolchain used to build
4+
and publish the package. Assumes Python is already set up by the caller.
5+
6+
runs:
7+
using: "composite"
8+
steps:
9+
- shell: bash
10+
run: |
11+
python -m pip install --upgrade pip
12+
pip install "virtualenv<20.36"
13+
pip install hatchling==1.27.0 hatch==1.14.0

.github/workflows/docker-stable.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ jobs:
4545
with:
4646
push: true
4747
platforms: linux/amd64,linux/arm64
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max
4850
tags: socketdev/cli:stable
4951
build-args: |
5052
CLI_VERSION=${{ inputs.version }}

.github/workflows/pr-preview.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ on:
33
pull_request:
44
types: [opened, synchronize, ready_for_review]
55

6+
# Cancel an in-flight preview when the PR is pushed again -- previews are slow
7+
# (publish + multi-step Docker build), so superseded runs shouldn't keep going.
8+
concurrency:
9+
group: pr-preview-${{ github.event.pull_request.number }}
10+
cancel-in-progress: true
11+
612
jobs:
713
preview:
814
# Skip on:
@@ -26,12 +32,8 @@ jobs:
2632
with:
2733
python-version: '3.13'
2834

29-
# Install all dependencies from pyproject.toml
30-
- name: Install dependencies
31-
run: |
32-
python -m pip install --upgrade pip
33-
pip install "virtualenv<20.36"
34-
pip install hatchling==1.27.0 hatch==1.14.0
35+
- name: Install build tooling
36+
uses: ./.github/actions/setup-hatch
3537

3638
- name: Inject full dynamic version
3739
run: python .hooks/sync_version.py --dev
@@ -159,7 +161,12 @@ jobs:
159161
VERSION: ${{ env.VERSION }}
160162
with:
161163
push: true
162-
platforms: linux/amd64,linux/arm64
164+
# Preview images are for quick testing -- build amd64 only. arm64 via
165+
# QEMU emulation is the slowest part of the job; release builds keep
166+
# multi-arch. GHA layer cache speeds up repeated preview builds.
167+
platforms: linux/amd64
168+
cache-from: type=gha
169+
cache-to: type=gha,mode=max
163170
tags: |
164171
socketdev/cli:pr-${{ github.event.pull_request.number }}
165172
build-args: |

.github/workflows/release.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,9 @@ jobs:
1818
with:
1919
python-version: '3.13'
2020

21-
# Install all dependencies from pyproject.toml
22-
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade pip
25-
pip install "virtualenv<20.36"
26-
pip install hatchling==1.27.0 hatch==1.14.0
27-
21+
- name: Install build tooling
22+
uses: ./.github/actions/setup-hatch
23+
2824
- name: Get Version
2925
id: version
3026
env:
@@ -112,6 +108,8 @@ jobs:
112108
with:
113109
push: true
114110
platforms: linux/amd64,linux/arm64
111+
cache-from: type=gha
112+
cache-to: type=gha,mode=max
115113
tags: |
116114
socketdev/cli:latest
117115
socketdev/cli:${{ env.VERSION }}

0 commit comments

Comments
 (0)