Skip to content

1.0.3

1.0.3 #151

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- main
- develop
paths:
- .github/workflows/ci.yml
- 'Dockerfile'
- 'scripts/prepare-docker-base-dependencies.sh'
- 'scripts/github-cache-cleanup.sh'
- 'scripts/coverage-report.sh'
- 'bootstrap/**'
- 'CMakeLists.txt'
pull_request:
paths:
- .github/workflows/ci.yml
- 'Dockerfile'
- 'scripts/prepare-docker-base-dependencies.sh'
- 'scripts/github-cache-cleanup.sh'
- 'scripts/coverage-report.sh'
- 'bootstrap/**'
- 'CMakeLists.txt'
jobs:
cleanup:
name: Cleanup Duplicated Cache Keys
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cleanup Duplicated Cache Keys
run: |
./scripts/github-cache-cleanup.sh ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} --duplicates
builder-env:
name: Build and Push `builder-env` Stage
runs-on: ubuntu-24.04
needs: [cleanup]
env:
BUILD_TARGET: builder-env
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to DockerHub
run: echo "${{ secrets.DOCKER_PASSWORD}}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Set up Docker CLI
id: buildx
uses: docker/setup-buildx-action@v3
- name: (try to)Restore cached docker-dependencies-base
id: cache-docker-dependencies-base-restore
uses: actions/cache/restore@v4
with:
path: |
.deps
key: ${{ runner.os }}-docker-dependencies-base-${{ hashFiles('scripts/prepare-docker-base-dependencies.sh', 'bootstrap/bootstrap.gaussianblur.sh') }}
- name: Cleanup older cache for docker-dependencies-base
run: |
./scripts/github-cache-cleanup.sh ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} --old --prefix ${{ runner.os }}-docker-dependencies-base --exclude ${{ steps.cache-docker-dependencies-base-restore.outputs.cache-primary-key }}
- name: Prepare Docker base dependencies if cache miss
if: steps.cache-docker-dependencies-base-restore.outputs.cache-hit != 'true'
run: ./scripts/prepare-docker-base-dependencies.sh
- name: Save docker base dependencies if cache miss
if: steps.cache-docker-dependencies-base-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
.deps
key: ${{ steps.cache-docker-dependencies-base-restore.outputs.cache-primary-key }}
- name: Create docker builder-env cache directory
run: mkdir -p .docker/.cache-${{ env.BUILD_TARGET }}
- name: (try to)Restore cached docker-builder-env
id: cache-docker-restore
uses: actions/cache/restore@v4
with:
path: |
.docker/.cache-${{ env.BUILD_TARGET }}
key: ${{ runner.os }}-docker-${{ env.BUILD_TARGET }}-${{ hashFiles('Dockerfile', 'bootstrap/bootstrap.gaussianblur.sh', 'scripts/prepare-docker-base-dependencies.sh') }}
- name: Cleanup older cache for docker-builder-env
run: |
./scripts/github-cache-cleanup.sh ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} --old --prefix ${{ runner.os }}-docker-${{ env.BUILD_TARGET }} --exclude ${{ steps.cache-docker-restore.outputs.cache-primary-key }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
target: ${{ env.BUILD_TARGET }}
cache-from: type=local,src=.docker/.cache-${{ env.BUILD_TARGET }}
cache-to: type=local,dest=.docker/.cache-${{ env.BUILD_TARGET }}
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/libgaussianblur:${{ env.BUILD_TARGET }}
- name: Save docker-builder-env if cache miss
if: steps.cache-docker-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
.docker/.cache-${{ env.BUILD_TARGET }}
key: ${{ steps.cache-docker-restore.outputs.cache-primary-key }}
linux:
name: Build and Push `linux` Stage
runs-on: ubuntu-24.04
needs: [builder-env]
env:
BUILD_TARGET: linux
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to DockerHub
run: echo "${{ secrets.DOCKER_PASSWORD}}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Set up Docker CLI
id: buildx
uses: docker/setup-buildx-action@v3
- name: Restore cached docker-dependencies-base
uses: actions/cache/restore@v4
with:
path: |
.deps
key: ${{ runner.os }}-docker-dependencies-base-${{ hashFiles('scripts/prepare-docker-base-dependencies.sh', 'bootstrap/bootstrap.gaussianblur.sh') }}
- name: (try to)Restore cached docker-linux
id: cache-docker-restore
uses: actions/cache/restore@v4
with:
path: |
.docker/.cache-${{ env.BUILD_TARGET }}
key: ${{ runner.os }}-docker-${{ env.BUILD_TARGET }}-${{ hashFiles('Dockerfile', 'bootstrap/bootstrap.gaussianblur.sh', 'scripts/prepare-docker-base-dependencies.sh') }}
- name: Cleanup older cache for docker-linux
run: |
./scripts/github-cache-cleanup.sh ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} --old --prefix ${{ runner.os }}-docker-${{ env.BUILD_TARGET }} --exclude ${{ steps.cache-docker-restore.outputs.cache-primary-key }}
- name: Restore cached docker-builder-env
if: steps.cache-docker-restore.outputs.cache-hit != 'true'
uses: actions/cache/restore@v4
with:
path: |
.docker/.cache-builder-env
key: ${{ runner.os }}-docker-builder-env-${{ hashFiles('Dockerfile', 'bootstrap/bootstrap.gaussianblur.sh', 'scripts/prepare-docker-base-dependencies.sh') }}
- name: Copy contents of docker-builder-env cache to linux cache if cache miss (recycle cache on first run)
if: steps.cache-docker-restore.outputs.cache-hit != 'true'
run: |
mkdir -p .docker/.cache-${{ env.BUILD_TARGET }}
cp -r .docker/.cache-builder-env/* .docker/.cache-${{ env.BUILD_TARGET }}/
- name: Build and push Docker image (linux)
uses: docker/build-push-action@v5
with:
context: .
target: ${{ env.BUILD_TARGET }}
cache-from: type=local,src=.docker/.cache-${{ env.BUILD_TARGET }}
cache-to: type=local,dest=.docker/.cache-${{ env.BUILD_TARGET }}
outputs: type=local,dest=./output-${{ env.BUILD_TARGET }}
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/libgaussianblur:${{ env.BUILD_TARGET }}
- name: Save docker linux if cache miss
if: steps.cache-docker-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
.docker/.cache-${{ env.BUILD_TARGET }}
key: ${{ steps.cache-docker-restore.outputs.cache-primary-key }}
- name: Upload linux artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_TARGET }}-artifacts-${{ github.sha }}
path: output-${{ env.BUILD_TARGET }}/app/external
compression-level: 9
test:
name: Run Tests
runs-on: ubuntu-24.04
needs: [linux]
steps:
- name: Run tests
run: |
docker run --rm ${{ secrets.DOCKER_USERNAME }}/libgaussianblur:linux ./GaussianBlurTests
coverage:
name: Generate Coverage Report
runs-on: ubuntu-24.04
needs: [test]
env:
BUILD_TARGET: coverage
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to DockerHub
run: echo "${{ secrets.DOCKER_PASSWORD}}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Set up Docker CLI
id: buildx
uses: docker/setup-buildx-action@v3
- name: Restore cached docker-dependencies-base
uses: actions/cache/restore@v4
with:
path: |
.deps
key: ${{ runner.os }}-docker-dependencies-base-${{ hashFiles('scripts/prepare-docker-base-dependencies.sh', 'bootstrap/bootstrap.gaussianblur.sh') }}
- name: (try to)Restore cached docker-coverage
id: cache-docker-restore
uses: actions/cache/restore@v4
with:
path: |
.docker/.cache-${{ env.BUILD_TARGET }}
key: ${{ runner.os }}-docker-${{ env.BUILD_TARGET }}-${{ hashFiles('Dockerfile', 'bootstrap/bootstrap.gaussianblur.sh', 'scripts/prepare-docker-base-dependencies.sh', 'scripts/coverage-report.sh') }}
- name: Cleanup older cache for docker-coverage
run: |
./scripts/github-cache-cleanup.sh ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} --old --prefix ${{ runner.os }}-docker-${{ env.BUILD_TARGET }} --exclude ${{ steps.cache-docker-restore.outputs.cache-primary-key }}
- name: Restore cached docker-builder-env
if: steps.cache-docker-restore.outputs.cache-hit != 'true'
uses: actions/cache/restore@v4
with:
path: |
.docker/.cache-builder-env
key: ${{ runner.os }}-docker-builder-env-${{ hashFiles('Dockerfile', 'bootstrap/bootstrap.gaussianblur.sh', 'scripts/prepare-docker-base-dependencies.sh') }}
- name: Copy contents of docker-builder-env cache to coverage cache if cache miss (recycle cache on first run)
if: steps.cache-docker-restore.outputs.cache-hit != 'true'
run: |
mkdir -p .docker/.cache-${{ env.BUILD_TARGET }}
cp -r .docker/.cache-builder-env/* .docker/.cache-${{ env.BUILD_TARGET }}/
- name: Build Docker image (coverage)
uses: docker/build-push-action@v5
with:
context: .
target: ${{ env.BUILD_TARGET }}
cache-from: type=local,src=.docker/.cache-${{ env.BUILD_TARGET }}
cache-to: type=local,dest=.docker/.cache-${{ env.BUILD_TARGET }}
outputs: type=local,dest=./output-${{ env.BUILD_TARGET }}
push: false
tags: ${{ secrets.DOCKER_USERNAME }}/libgaussianblur:${{ env.BUILD_TARGET }}
- name: Save docker coverage if cache miss
if: steps.cache-docker-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
.docker/.cache-${{ env.BUILD_TARGET }}
key: ${{ steps.cache-docker-restore.outputs.cache-primary-key }}
- name: Generate coverage badge
uses: ImBIOS/lcov-coverage-badge@v1.0.1
with:
file: output-${{ env.BUILD_TARGET }}/app/coverage/lcov.info
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_TARGET }}-artifacts-${{ github.sha }}
path: output-${{ env.BUILD_TARGET }}/app/coverage
compression-level: 9
android:
name: Build and Push `android` Target
runs-on: ubuntu-24.04
needs: [test]
env:
BUILD_TARGET: android
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to DockerHub
run: echo "${{ secrets.DOCKER_PASSWORD}}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Set up Docker CLI
uses: docker/setup-buildx-action@v3
- name: Restore cached docker-dependencies-base
uses: actions/cache/restore@v4
with:
path: |
.deps
key: ${{ runner.os }}-docker-dependencies-base-${{ hashFiles('scripts/prepare-docker-base-dependencies.sh', 'bootstrap/bootstrap.gaussianblur.sh') }}
- name: (try to)Restore cached docker-android
id: cache-docker-restore
uses: actions/cache/restore@v4
with:
path: |
.docker/.cache-${{ env.BUILD_TARGET }}
key: ${{ runner.os }}-docker-${{ env.BUILD_TARGET }}-${{ hashFiles('Dockerfile', 'bootstrap/bootstrap.gaussianblur.sh', 'scripts/prepare-docker-base-dependencies.sh') }}
- name: Cleanup older cache for docker-android
run: |
./scripts/github-cache-cleanup.sh ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} --old --prefix ${{ runner.os }}-docker-${{ env.BUILD_TARGET }} --exclude ${{ steps.cache-docker-restore.outputs.cache-primary-key }}
- name: Restore cached docker-builder-env
if: steps.cache-docker-restore.outputs.cache-hit != 'true'
uses: actions/cache/restore@v4
with:
path: |
.docker/.cache-builder-env
key: ${{ runner.os }}-docker-builder-env-${{ hashFiles('Dockerfile', 'bootstrap/bootstrap.gaussianblur.sh', 'scripts/prepare-docker-base-dependencies.sh') }}
- name: Copy contents of docker-builder-env cache to android cache if cache miss (recycle cache on first run)
if: steps.cache-docker-restore.outputs.cache-hit != 'true'
run: |
mkdir -p .docker/.cache-${{ env.BUILD_TARGET }}
cp -r .docker/.cache-builder-env/* .docker/.cache-${{ env.BUILD_TARGET }}/
- name: Build and push Docker image (android)
uses: docker/build-push-action@v5
with:
context: .
target: ${{ env.BUILD_TARGET }}
cache-from: type=local,src=.docker/.cache-${{ env.BUILD_TARGET }}
cache-to: type=local,dest=.docker/.cache-${{ env.BUILD_TARGET }}
outputs: type=local,dest=./output-${{ env.BUILD_TARGET }}
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/libgaussianblur:${{ env.BUILD_TARGET }}
- name: Save docker android if cache miss
if: steps.cache-docker-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
.docker/.cache-${{ env.BUILD_TARGET }}
key: ${{ steps.cache-docker-restore.outputs.cache-primary-key }}
- name: Upload android artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_TARGET }}-artifacts-${{ github.sha }}
path: output-${{ env.BUILD_TARGET }}/app/external
compression-level: 9
wasm:
name: Build and Push `wasm` Target
runs-on: ubuntu-24.04
needs: [test]
env:
BUILD_TARGET: wasm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to DockerHub
run: echo "${{ secrets.DOCKER_PASSWORD}}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Set up Docker CLI
uses: docker/setup-buildx-action@v3
- name: Restore cached docker-dependencies-base
uses: actions/cache/restore@v4
with:
path: |
.deps
key: ${{ runner.os }}-docker-dependencies-base-${{ hashFiles('scripts/prepare-docker-base-dependencies.sh', 'bootstrap/bootstrap.gaussianblur.sh') }}
- name: (try to)Restore cached docker-wasm
id: cache-docker-restore
uses: actions/cache/restore@v4
with:
path: |
.docker/.cache-${{ env.BUILD_TARGET }}
key: ${{ runner.os }}-docker-${{ env.BUILD_TARGET }}-${{ hashFiles('Dockerfile', 'bootstrap/bootstrap.gaussianblur.sh', 'scripts/prepare-docker-base-dependencies.sh') }}
- name: Cleanup older cache for docker-wasm
run: |
./scripts/github-cache-cleanup.sh ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} --old --prefix ${{ runner.os }}-docker-${{ env.BUILD_TARGET }} --exclude ${{ steps.cache-docker-restore.outputs.cache-primary-key }}
- name: Restore cached docker-builder-env
if: steps.cache-docker-restore.outputs.cache-hit != 'true'
uses: actions/cache/restore@v4
with:
path: |
.docker/.cache-builder-env
key: ${{ runner.os }}-docker-builder-env-${{ hashFiles('Dockerfile', 'bootstrap/bootstrap.gaussianblur.sh', 'scripts/prepare-docker-base-dependencies.sh') }}
- name: Copy contents of docker-builder-env cache to wasm cache if cache miss (recycle cache on first run)
if: steps.cache-docker-restore.outputs.cache-hit != 'true'
run: |
mkdir -p .docker/.cache-${{ env.BUILD_TARGET }}
cp -r .docker/.cache-builder-env/* .docker/.cache-${{ env.BUILD_TARGET }}/
- name: Build and push Docker image (wasm)
uses: docker/build-push-action@v5
with:
context: .
target: ${{ env.BUILD_TARGET }}
cache-from: type=local,src=.docker/.cache-${{ env.BUILD_TARGET }}
cache-to: type=local,dest=.docker/.cache-${{ env.BUILD_TARGET }}
outputs: type=local,dest=./output-${{ env.BUILD_TARGET }}
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/libgaussianblur:${{ env.BUILD_TARGET }}
- name: Save docker wasm if cache miss
if: steps.cache-docker-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
.docker/.cache-${{ env.BUILD_TARGET }}
key: ${{ steps.cache-docker-restore.outputs.cache-primary-key }}
- name: Upload wasm artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_TARGET }}-artifacts-${{ github.sha }}
path: output-${{ env.BUILD_TARGET }}/app/external
compression-level: 9