ci: remove single-container build from dev workflow
Reduces CI time by only building the multi-container Dockerfile during pull requests. The single-container build is still available in the production build-and-release workflow.
This commit is contained in:
parent
478ca299d1
commit
fc872ff6e3
1 changed files with 14 additions and 68 deletions
82
.github/workflows/build-dev.yml
vendored
82
.github/workflows/build-dev.yml
vendored
|
|
@ -12,15 +12,6 @@ on:
|
||||||
- '.github/workflows/claude*.yml'
|
- '.github/workflows/claude*.yml'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
dockerfile:
|
|
||||||
description: 'Dockerfile to test'
|
|
||||||
required: true
|
|
||||||
default: 'both'
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- both
|
|
||||||
- regular
|
|
||||||
- single
|
|
||||||
platform:
|
platform:
|
||||||
description: 'Platform to build'
|
description: 'Platform to build'
|
||||||
required: true
|
required: true
|
||||||
|
|
@ -43,7 +34,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Extract version from pyproject.toml
|
- name: Extract version from pyproject.toml
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -51,10 +42,9 @@ jobs:
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "Extracted version: $VERSION"
|
echo "Extracted version: $VERSION"
|
||||||
|
|
||||||
test-build-regular:
|
test-build:
|
||||||
needs: extract-version
|
needs: extract-version
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event.inputs.dockerfile == 'regular' || github.event.inputs.dockerfile == 'both' || github.event_name != 'workflow_dispatch'
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
@ -66,18 +56,18 @@ jobs:
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache-dev
|
path: /tmp/.buildx-cache-dev
|
||||||
key: ${{ runner.os }}-buildx-dev-regular-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-dev-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-dev-regular-
|
${{ runner.os }}-buildx-dev-
|
||||||
|
|
||||||
- name: Build regular image (test only)
|
- name: Build image (test only)
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
platforms: ${{ github.event.inputs.platform || 'linux/amd64' }}
|
platforms: ${{ github.event.inputs.platform || 'linux/amd64' }}
|
||||||
push: false
|
push: false
|
||||||
tags: ${{ env.IMAGE_NAME }}:${{ needs.extract-version.outputs.version }}-dev-regular
|
tags: ${{ env.IMAGE_NAME }}:${{ needs.extract-version.outputs.version }}-dev
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache-dev
|
cache-from: type=local,src=/tmp/.buildx-cache-dev
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-dev-new,mode=max
|
cache-to: type=local,dest=/tmp/.buildx-cache-dev-new,mode=max
|
||||||
|
|
||||||
|
|
@ -86,43 +76,8 @@ jobs:
|
||||||
rm -rf /tmp/.buildx-cache-dev
|
rm -rf /tmp/.buildx-cache-dev
|
||||||
mv /tmp/.buildx-cache-dev-new /tmp/.buildx-cache-dev
|
mv /tmp/.buildx-cache-dev-new /tmp/.buildx-cache-dev
|
||||||
|
|
||||||
test-build-single:
|
|
||||||
needs: extract-version
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event.inputs.dockerfile == 'single' || github.event.inputs.dockerfile == 'both' || github.event_name != 'workflow_dispatch'
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Cache Docker layers
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: /tmp/.buildx-cache-dev-single
|
|
||||||
key: ${{ runner.os }}-buildx-dev-single-${{ github.sha }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-buildx-dev-single-
|
|
||||||
|
|
||||||
- name: Build single-container image (test only)
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile.single
|
|
||||||
platforms: ${{ github.event.inputs.platform || 'linux/amd64' }}
|
|
||||||
push: false
|
|
||||||
tags: ${{ env.IMAGE_NAME }}:${{ needs.extract-version.outputs.version }}-dev-single
|
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache-dev-single
|
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-dev-single-new,mode=max
|
|
||||||
|
|
||||||
- name: Move cache
|
|
||||||
run: |
|
|
||||||
rm -rf /tmp/.buildx-cache-dev-single
|
|
||||||
mv /tmp/.buildx-cache-dev-single-new /tmp/.buildx-cache-dev-single
|
|
||||||
|
|
||||||
summary:
|
summary:
|
||||||
needs: [extract-version, test-build-regular, test-build-single]
|
needs: [extract-version, test-build]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: always()
|
if: always()
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -131,27 +86,18 @@ jobs:
|
||||||
echo "## Development Build Summary" >> $GITHUB_STEP_SUMMARY
|
echo "## Development Build Summary" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "**Version:** ${{ needs.extract-version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
|
echo "**Version:** ${{ needs.extract-version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "**Platform:** ${{ github.event.inputs.platform || 'linux/amd64' }}" >> $GITHUB_STEP_SUMMARY
|
echo "**Platform:** ${{ github.event.inputs.platform || 'linux/amd64' }}" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "**Dockerfile:** ${{ github.event.inputs.dockerfile || 'both' }}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "### Results:" >> $GITHUB_STEP_SUMMARY
|
echo "### Results:" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
if [[ "${{ needs.test-build-regular.result }}" == "success" ]]; then
|
if [[ "${{ needs.test-build.result }}" == "success" ]]; then
|
||||||
echo "✅ **Regular Dockerfile:** Build successful" >> $GITHUB_STEP_SUMMARY
|
echo "✅ **Dockerfile:** Build successful" >> $GITHUB_STEP_SUMMARY
|
||||||
elif [[ "${{ needs.test-build-regular.result }}" == "skipped" ]]; then
|
elif [[ "${{ needs.test-build.result }}" == "skipped" ]]; then
|
||||||
echo "⏭️ **Regular Dockerfile:** Skipped" >> $GITHUB_STEP_SUMMARY
|
echo "⏭️ **Dockerfile:** Skipped" >> $GITHUB_STEP_SUMMARY
|
||||||
else
|
else
|
||||||
echo "❌ **Regular Dockerfile:** Build failed" >> $GITHUB_STEP_SUMMARY
|
echo "❌ **Dockerfile:** Build failed" >> $GITHUB_STEP_SUMMARY
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${{ needs.test-build-single.result }}" == "success" ]]; then
|
|
||||||
echo "✅ **Single Dockerfile:** Build successful" >> $GITHUB_STEP_SUMMARY
|
|
||||||
elif [[ "${{ needs.test-build-single.result }}" == "skipped" ]]; then
|
|
||||||
echo "⏭️ **Single Dockerfile:** Skipped" >> $GITHUB_STEP_SUMMARY
|
|
||||||
else
|
|
||||||
echo "❌ **Single Dockerfile:** Build failed" >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "### Notes:" >> $GITHUB_STEP_SUMMARY
|
echo "### Notes:" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- This is a development build (no images pushed to registry)" >> $GITHUB_STEP_SUMMARY
|
echo "- This is a development build (no images pushed to registry)" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- For production releases, use the 'Build and Release' workflow" >> $GITHUB_STEP_SUMMARY
|
echo "- For production releases, use the 'Build and Release' workflow" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue