ACS-4624 Migrate to GHA (#648)

* ACS-4624 Migrate to GHA

* ACS-4624 Rename to .ci.settings.xml

* ACS-4624 Change java version to 11

* ACS-4624 Fix build

* ACS-4624 Add login to docker/quay steps

* ACS-4624 Add publish job + remove .travis.yml

* ACS-4624 Improve branch filter

* ACS-4624 Remove useless global var

* ACS-4624 Add oss sonatype credentials

* ACS-4624 Remove MAVEN_INSTALL_CMD
This commit is contained in:
Damian Ujma
2023-02-20 17:19:49 +01:00
committed by GitHub
parent 9a5e70f324
commit 515d23de2c
5 changed files with 120 additions and 108 deletions

118
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,118 @@
name: Alfresco SDK CI
on:
pull_request:
branches:
- master
- fix/**
- feature/**
- sdk-4.5
push:
branches:
- master
- fix/**
- feature/**
- sdk-4.5
workflow_dispatch:
env:
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
MAVEN_CLI_OPTS: "-B -q -e -fae -V -DinstallAtEnd=true -U"
jobs:
pre_commit:
runs-on: ubuntu-latest
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v1.35.0
build:
name: "Build application"
runs-on: ubuntu-latest
needs: [pre_commit]
if: "!contains(github.event.head_commit.message, '[skip tests]')"
steps:
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.0
- name: "Build"
run: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
- name: "Verify"
run: mvn $MAVEN_CLI_OPTS verify -Dlogging.root.level=off -Dspring.main.banner-mode=off
tests:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
needs: [build]
if: "!contains(github.event.head_commit.message, '[skip tests]')"
strategy:
fail-fast: false
matrix:
include:
- name: "current version Java 17"
java-version: 17
- name: "current version Java 11"
java-version: 11
- name: "7.3 Enterprise Java 17"
java-version: 17
suite: -Penterprise-73-tests
- name: "7.3 Community Java 17"
java-version: 17
suite: -Pcommunity-73-tests
- name: "7.3 Enterprise Java 11"
java-version: 11
suite: -Penterprise-73-tests
- name: "7.3 Community Java 11"
java-version: 11
suite: -Pcommunity-73-tests
- name: "7.2 Enterprise"
java-version: 11
suite: -Penterprise-72-tests
- name: "7.2 Community"
java-version: 11
suite: -Pcommunity-72-tests
- name: "7.1 Enterprise"
java-version: 11
suite: -Penterprise-71-tests
- name: "7.1 Community"
java-version: 11
suite: -Pcommunity-71-tests
- name: "7.0 Enterprise"
java-version: 11
suite: -Penterprise-70-tests
- name: "7.0 Community"
java-version: 11
suite: -Pcommunity-70-tests
steps:
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.0
with:
java-version: ${{ matrix.java-version }}
- 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: "Build"
run: mvn clean install -B ${{ matrix.suite }}
publish:
name: "Publish artifacts"
runs-on: ubuntu-latest
needs: [tests]
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.0
- name: "Build"
run: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
- name: "Publish"
run: mvn $MAVEN_CLI_OPTS deploy -DskipTests

View File

@@ -1,106 +0,0 @@
import:
- source: Alfresco/alfresco-build-tools:.travis.docker_login.yml@v1.1.5
- source: Alfresco/alfresco-build-tools:.travis.docker_hub_login.yml@v1.1.5
- source: Alfresco/alfresco-build-tools:.travis.java.yml@v1.1.5
- source: Alfresco/alfresco-build-tools:.travis.pre-commit.yml@v1.1.5
dist: focal
jdk:
- openjdk17
- openjdk11
git:
depth: false
quiet: true
branches:
only:
- master
- /feature\/.*/
- /fix\/.*/
- sdk-4.5
stages:
- name: test
if: commit_message !~ /\[skip tests\]/
- name: release
if: commit_message ~= /\[release\]/ AND branch = master AND type != push AND type != pull_request AND fork = false
env:
global:
- MAVEN_INSTALL_CMD="mvn clean install -B"
jobs:
include:
- name: "current version Java 17"
stage: test
jdk: openjdk17
script:
- ${MAVEN_INSTALL_CMD}
- name: "current version Java 11"
stage: test
jdk: openjdk11
script:
- ${MAVEN_INSTALL_CMD}
- name: "7.3 Enterprise Java 17"
stage: test
jdk: openjdk17
script:
- ${MAVEN_INSTALL_CMD} -Penterprise-73-tests
- name: "7.3 Community Java 17"
stage: test
jdk: openjdk17
script:
- ${MAVEN_INSTALL_CMD} -Pcommunity-73-tests
- name: "7.3 Enterprise Java 11"
stage: test
jdk: openjdk11
script:
- ${MAVEN_INSTALL_CMD} -Penterprise-73-tests
- name: "7.3 Community Java 11"
stage: test
jdk: openjdk11
script:
- ${MAVEN_INSTALL_CMD} -Pcommunity-73-tests
- name: "7.2 Enterprise"
stage: test
jdk: openjdk11
script:
- ${MAVEN_INSTALL_CMD} -Penterprise-72-tests
- name: "7.2 Community"
stage: test
jdk: openjdk11
script:
- ${MAVEN_INSTALL_CMD} -Pcommunity-72-tests
- name: "7.1 Enterprise"
stage: test
jdk: openjdk11
script:
- ${MAVEN_INSTALL_CMD} -Penterprise-71-tests
- name: "7.1 Community"
stage: test
jdk: openjdk11
script:
- ${MAVEN_INSTALL_CMD} -Pcommunity-71-tests
- name: "7.0 Enterprise"
stage: test
jdk: openjdk11
script:
- ${MAVEN_INSTALL_CMD} -Penterprise-70-tests
- name: "7.0 Community"
stage: test
jdk: openjdk11
script:
- ${MAVEN_INSTALL_CMD} -Pcommunity-70-tests

View File

@@ -1,7 +1,7 @@
# [![Alfresco SDK logo](https://github.com/Alfresco/alfresco-sdk/raw/master/src/site/resources/img/alfresco-maven-logo.jpg)](#features) Alfresco SDK
[![Build Status](https://travis-ci.com/Alfresco/alfresco-sdk.svg?branch=master)](https://travis-ci.com/Alfresco/alfresco-sdk)
[![Build Status](https://github.com/Alfresco/alfresco-sdk/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Alfresco/alfresco-sdk/actions/workflows/ci.yml)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
![GitHub](https://img.shields.io/github/license/Alfresco/alfresco-sdk?color=brightgreen)

View File

@@ -405,7 +405,7 @@
<id>alfresco-private-repository</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/private</url>
</repository>
<!-- Activiti Enterprise Edition Artifacts, put username/pwd for server in settings.xml -->
<!-- Activiti Enterprise Edition Artifacts, put username/pwd for server in .ci.settings.xml -->
<repository>
<id>activiti-private-repository</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/activiti-enterprise-releases</url>