Skip to content

OPSEXP-2333 test step #347

OPSEXP-2333 test step

OPSEXP-2333 test step #347

Workflow file for this run

name: Build
on:
push:
paths-ignore:
- README.md
jobs:
build_rpm:
name: Build on ${{ matrix.base_image }} for ${{ matrix.target_arch }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- base_image: rockylinux:9
target_arch: x86_64
nexus_classifier: el9
- base_image: rockylinux:8
target_arch: x86_64
nexus_classifier: el8
- base_image: rockylinux:8
target_arch: aarch64
nexus_classifier: el8-aarch64
- base_image: centos:7
target_arch: x86_64
nexus_classifier: el7
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set build variables
id: variables
run: |
echo "imagemagick_version=$(cat ./imagemagick-version)" >> $GITHUB_OUTPUT
echo "imagemagick_release=$(cat ./release-version)" >> $GITHUB_OUTPUT
- name: Prepare image
run: docker build . -t buildenv --build-arg BASE_IMAGE=${{ matrix.base_image }}
working-directory: rpms
- name: Build and Install
run: docker run --name build buildenv ${{ steps.variables.outputs.imagemagick_version }} ${{ matrix.target_arch }}
- name: Retrieve built packages
env:
IMAGEMAGICK_VERSION: ${{ steps.variables.outputs.imagemagick_version }}
run: |
docker cp build:/root/rpmbuild/RPMS/ .
ls -l RPMS/
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.nexus_classifier }}-rpm
path: RPMS/${{ matrix.target_arch }}/*.rpm
- name: Deploy to nexus
uses: Alfresco/alfresco-build-tools/.github/actions/maven-deploy-file@9fd78f71c1ccbad03b79b81db541693cd9cfc89b
if: startsWith(github.ref, 'refs/tags/v')
with:
group-id: org.imagemagick
artifact-id: imagemagick-distribution
repository-url: https://nexus.alfresco.com/nexus/content/repositories/thirdparty/
version: ${{ steps.variables.outputs.imagemagick_version }}-ci-${{ steps.variables.outputs.imagemagick_release }}
generate-pom: false
file: RPMS/${{ matrix.target_arch }}/ImageMagick-${{ steps.variables.outputs.imagemagick_version }}.${{ matrix.target_arch }}.rpm
classifier: ${{ matrix.nexus_classifier }}
files: RPMS/${{ matrix.target_arch }}/ImageMagick-libs-${{ steps.variables.outputs.imagemagick_version }}.${{ matrix.target_arch }}.rpm
classifiers: ${{ matrix.nexus_classifier }}-libs
types: rpm
maven-username: ${{ secrets.NEXUS_USERNAME }}
maven-password: ${{ secrets.NEXUS_PASSWORD }}
test_and_run_command:
name: Test and Run Command on ${{ matrix.base_image }} for ${{ matrix.target_arch }}
runs-on: ubuntu-latest
needs: build_rpm
strategy:
matrix:
include:
- base_image: rockylinux:9
target_arch: x86_64
nexus_classifier: el9
- base_image: rockylinux:8
target_arch: x86_64
nexus_classifier: el8
- base_image: rockylinux:8
target_arch: aarch64
nexus_classifier: el8-aarch64
- base_image: centos:7
target_arch: x86_64
nexus_classifier: el7
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set build variables
id: variables
run: |
echo "imagemagick_version=$(cat ./imagemagick-version)" >> $GITHUB_OUTPUT
echo "imagemagick_release=$(cat ./release-version)" >> $GITHUB_OUTPUT
- name: Download RPMs
uses: actions/download-artifact@v2
with:
name: ${{ matrix.nexus_classifier }}-rpm
- name: list RPMs
run: ls -R
- name: Create a fresh OS container
run: |
docker run --name testenv -d -it ${{ matrix.base_image }}
sleep 5
- name: Copy RPMs to the fresh container
run: |
docker cp ImageMagick-libs-${{ steps.variables.outputs.imagemagick_version }}.${{ matrix.target_arch }}.rpm testenv:/
docker cp ImageMagick-${{ steps.variables.outputs.imagemagick_version }}.${{ matrix.target_arch }}.rpm testenv:/
- name: Install RPMs on the fresh container
run: |
docker exec -t testenv yum install -y epel-release
docker exec -t testenv yum install -y ImageMagick-libs-${{ steps.variables.outputs.imagemagick_version }}.${{ matrix.target_arch }}.rpm
docker exec -t testenv yum install -y ImageMagick-${{ steps.variables.outputs.imagemagick_version }}.${{ matrix.target_arch }}.rpm
- name: Install RPMs on the fresh container
run: |
docker exec -t testenv ldd /usr/bin/convert
docker exec -t testenv convert -version
convert -size 32x32 xc:transparent test.png
convert test.png test1.jpg
build_ubuntu:
name: Build on ubuntu:${{ matrix.image_tag }} for x86_64
runs-on: ubuntu-latest
strategy:
matrix:
image_tag:
- 22.04
- 20.04
- 18.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set build variables
id: variables
run: |
echo "imagemagick_version=$(cat ./imagemagick-version)" >> $GITHUB_OUTPUT
echo "imagemagick_release=$(cat ./release-version)" >> $GITHUB_OUTPUT
- name: Prepare image
run: docker build . -t buildenv --build-arg IMAGE_TAG=${{ matrix.image_tag }}
working-directory: debs
- name: Build and Install
run: docker run --name build buildenv ${{ steps.variables.outputs.imagemagick_version }}
- name: Retrieve built packages
env:
IMAGEMAGICK_VERSION: ${{ steps.variables.outputs.imagemagick_version }}
run: |
docker cp build:/build/imagemagick-alfresco_${IMAGEMAGICK_VERSION}_amd64.deb .
docker cp build:/build/imagemagick-alfresco-dev_${IMAGEMAGICK_VERSION}_amd64.deb .
- uses: actions/upload-artifact@v3
with:
name: ubuntu${{ matrix.image_tag }}-deb
path: "*.deb"
- name: Deploy to nexus
uses: Alfresco/alfresco-build-tools/.github/actions/maven-deploy-file@9fd78f71c1ccbad03b79b81db541693cd9cfc89b
if: startsWith(github.ref, 'refs/tags/v')
with:
group-id: org.imagemagick
artifact-id: imagemagick-distribution
repository-url: https://nexus.alfresco.com/nexus/content/repositories/thirdparty/
version: ${{ steps.variables.outputs.imagemagick_version }}-ci-${{ steps.variables.outputs.imagemagick_release }}
generate-pom: false
file: ${{ github.workspace }}/imagemagick-alfresco_${{ steps.variables.outputs.imagemagick_version }}_amd64.deb
classifier: ubuntu-${{ matrix.image_tag }}
files: ${{ github.workspace }}/imagemagick-alfresco-dev_${{ steps.variables.outputs.imagemagick_version }}_amd64.deb
classifiers: ubuntu-${{ matrix.image_tag }}-dev
types: deb
maven-username: ${{ secrets.NEXUS_USERNAME }}
maven-password: ${{ secrets.NEXUS_PASSWORD }}