Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
186 changes: 186 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
name: Alfresco Transform Core CI

on:
push:
branches:
- master
- feature/**
- fix/**
- SP/**
- HF/**
- ATS-**
- ACS-**
- MNT-**
pull_request:
branches:
- master
- feature/**
- fix/**
- SP/**
- HF/**
schedule:
- cron: '0 5 * * 1'
workflow_dispatch:

env:
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
GIT_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }}
GIT_EMAIL: ${{ secrets.BOT_GITHUB_EMAIL }}
GIT_PASSWORD: ${{ secrets.BOT_GITHUB_TOKEN }}
GITHUB_ACTIONS_DEPLOY_TIMEOUT: 60

jobs:
veracode:
name: "Veracode - Source Clear Scan (SCA)"
runs-on: ubuntu-latest
if: >
github.ref_name == 'master' ||
github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.34.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.34.0
- name: "Clean-up SNAPSHOT artifacts"
run: find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf
- uses: Alfresco/alfresco-build-tools/.github/actions/veracode@v1.34.0
with:
srcclr-api-token: ${{ secrets.SRCCLR_API_TOKEN }}

build_and_test:
name: "Core & Base Snapshot deployment"
runs-on: ubuntu-latest
if: >
github.ref_name == 'master' &&
github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.34.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.34.0
- name: "Login to Docker Hub"
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: "Login to Quay.io"
uses: docker/login-action@v2.1.0
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: "Enable experimental docker features"
run: |
echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
- name: "Clean-up SNAPSHOT artifacts"
run: find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: mvn -B -U -q clean install -DadditionalOption=-Xdoclint:none -DskipTests -Dmaven.javadoc.skip=true -Dmaven.wagon.http.pool=false -Pbase
- name: "Cache LibreOffice"
run: bash _ci/cache_artifacts.sh
- name: "Run tests"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: mvn -B -U clean deploy -DadditionalOption=-Xdoclint:none -Dmaven.javadoc.skip=true -Dmaven.wagon.http.pool=false -Pbase

all_tests_matrix:
name: ${{ matrix.testName }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- testName: ImageMagick
buildProfile: imagemagick
testProfile: imagemagick
- testName: LibreOffice
buildProfile: libreoffice
testProfile: libreoffice
- testName: Transform Misc
buildProfile: misc
testProfile: misc
- testName: PDF Renderer
buildProfile: pdf-renderer
testProfile: pdf-renderer
- testName: Tika
buildProfile: tika
testProfile: tika
- testName: All in One Transformer
buildProfile: full-build
testProfile: aio-test
steps:
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.34.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.34.0
- name: "Login to Docker Hub"
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: "Login to Quay.io"
uses: docker/login-action@v2.1.0
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: "Enable experimental docker features"
run: |
echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
- name: "Clean-up SNAPSHOT artifacts"
run: find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf
- name: "Build local docker image"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: bash _ci/build.sh ${{ matrix.buildProfile }}
- name: "Cache LibreOffice"
run: bash _ci/cache_artifacts.sh
- name: "Run tests"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: bash _ci/test.sh ${{ matrix.testProfile }}

release:
name: "Release"
runs-on: ubuntu-latest
needs: [veracode, build_and_test, all_tests_matrix]
if: >
!failure() &&
contains(github.event.head_commit.message, '[release]') &&
github.event_name != 'pull_request' &&
(github.ref_name == 'master' || startsWith(github.ref_name, 'SP/') || startsWith(github.ref_name, 'HF/'))
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.34.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.34.0
- name: "Login to Docker Hub"
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: "Login to Quay.io"
uses: docker/login-action@v2.1.0
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: "Enable experimental docker features"
run: |
echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
- name: "Clean-up SNAPSHOT artifacts"
run: find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.34.0
with:
username: ${{ env.GIT_USERNAME }}
email: ${{ env.GIT_EMAIL }}
global: true
- name: "Cache LibreOffice"
run: bash _ci/cache_artifacts.sh
- name: "Release"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: bash _ci/release.sh
84 changes: 0 additions & 84 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Alfresco Transform Core
[![Build Status](https://travis-ci.com/Alfresco/alfresco-transform-core.svg?branch=master)](https://travis-ci.com/Alfresco/alfresco-transform-core)
[![Build Status](https://github.com/Alfresco/alfresco-transform-core/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Alfresco/alfresco-transform-core/actions/workflows/ci.yml)

Contains the common transformer (T-Engine) code, plus a few implementations.

Expand Down
2 changes: 1 addition & 1 deletion _ci/cache_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [ -f "${HOME}/artifacts/libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz" ];
echo "Using cached LibreOffice distribution..."
else
echo "Downloading LibreOffice distribution..."
curl -s -S ${LIBREOFFICE_RPM_URL} -o "${HOME}/artifacts/libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz"
curl -s -S ${LIBREOFFICE_RPM_URL} -o "${HOME}/artifacts/libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz" --create-dirs
fi
cp "${HOME}/artifacts/libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz" engines/libreoffice

Expand Down
20 changes: 0 additions & 20 deletions _ci/init.sh

This file was deleted.

8 changes: 3 additions & 5 deletions _ci/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ set -vex
pushd "$(dirname "${BASH_SOURCE[0]}")/../"

# For PR builds only execute a Dry Run of the release
[ "${TRAVIS_PULL_REQUEST}" = "false" ] && DRY_RUN="" || DRY_RUN="-DdryRun"
[ "${PULL_REQUEST}" = "false" ] && DRY_RUN="" || DRY_RUN="-DdryRun"

# Travis CI runner work on DETACHED HEAD, so we need to checkout the release branch
git checkout -B "${TRAVIS_BRANCH}"

git config user.email "build@alfresco.com"
# GitHub Actions CI runner work on DETACHED HEAD, so we need to checkout the release branch
git checkout -B "${BRANCH_NAME}"

# Run the release plugin - with "[skip ci]" in the release commit message
mvn -B -Dmaven.wagon.http.pool=false \
Expand Down
26 changes: 0 additions & 26 deletions _ci/source_clear.sh

This file was deleted.

4 changes: 2 additions & 2 deletions _ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ set -vex
pushd "$(dirname "${BASH_SOURCE[0]}")/../"

# Always build the image, but only publish from the "master" branch
[ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && PROFILE="internal" || PROFILE="local"
[ "${PULL_REQUEST}" = "false" ] && [ "${BRANCH_NAME}" = "master" ] && PROFILE="internal" || PROFILE="local"

# If the branch is "master" and the commit is not a Pull Request then deploy the JAR SNAPSHOT artifacts
[ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && DEPLOY="deploy" || DEPLOY="verify"
[ "${PULL_REQUEST}" = "false" ] && [ "${BRANCH_NAME}" = "master" ] && DEPLOY="deploy" || DEPLOY="verify"

# Do not deploy snapshots for alfresco-transform-core, alfresco-transformer-base and alfresco-base-t-engine
mvn -B -U -Dmaven.wagon.http.pool=false \
Expand Down
2 changes: 1 addition & 1 deletion deprecated/alfresco-transformer-base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ and the Alfresco Maven repository:
</repository>
~~~

The build plan is available in [TravisCI](https://travis-ci.com/Alfresco/alfresco-transform-core).
The build plan is available in [GitHub Actions CI](https://github.com/Alfresco/alfresco-transform-core/actions).

## Contributing guide

Expand Down
6 changes: 3 additions & 3 deletions docs/build-and-release.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build
The `alfresco-transform-core` project uses _Travis CI_. \
The `.travis.yml` config file can be found in the root of the repository.
The `alfresco-transform-core` project uses _GitHub Actions CI_. \
The `ci.yml` config file can be found in the `.github/workflows` directory of the project.


## Stages and Jobs
Expand All @@ -9,7 +9,7 @@ The `.travis.yml` config file can be found in the root of the repository.


## Branches
Travis CI builds differ by branch:
GitHub Actions CI builds differ by branch:
* `master` / `SP/*` / `HF/*` branches:
- regular builds which include the _Build_ stage;
> On the `master` branch only the _Build_ stage updates the `latest` T-Engines images on
Expand Down