mirror of
https://github.com/Alfresco/acs-community-packaging.git
synced 2026-09-16 18:13:21 +00:00
145 lines
5.7 KiB
YAML
145 lines
5.7 KiB
YAML
name: ACS Community Packaging CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- feature/ACS-3844_migrate-to-GHA
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
GITHUB_ACTIONS_DEPLOY_TIMEOUT: 60
|
|
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
|
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
|
|
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
|
|
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
|
|
TAS_ENVIRONMENT: ./tests/environment
|
|
TAS_SCRIPTS: ../alfresco-community-repo/packaging/tests/scripts
|
|
# Release version has to start with real version (7.4.0-....) for the docker image to build successfully.
|
|
RELEASE_VERSION: 7.4.0-A3
|
|
DEVELOPMENT_VERSION: 7.4.0-A4-SNAPSHOT
|
|
|
|
jobs:
|
|
configure_env:
|
|
name: Configure build env vars
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v1.23.0
|
|
- uses: ./.github/actions/get-build-info
|
|
|
|
tas_tests:
|
|
name: ${{ matrix.testSuite }} TAS tests
|
|
runs-on: ubuntu-latest
|
|
needs: configure_env
|
|
if: "!contains(github.event.head_commit.message, '[skip tas]') && !contains(github.event.head_commit.message, '[skip tests]')"
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- testSuite: REST API part1
|
|
pom: tests/tas-restapi/pom.xml
|
|
profiles: all-tas-tests,run-restapi-part1
|
|
compose-file: docker-compose-minimal+transforms.yml
|
|
- testSuite: REST API part2
|
|
pom: tests/tas-restapi/pom.xml
|
|
profiles: all-tas-tests,run-restapi-part2
|
|
compose-file: docker-compose-minimal+transforms.yml
|
|
- testSuite: REST API part3
|
|
pom: tests/tas-restapi/pom.xml
|
|
profiles: all-tas-tests,run-restapi-part3
|
|
compose-file: docker-compose-minimal+transforms.yml
|
|
- testSuite: CMIS (BROWSER binding)
|
|
pom: tests/tas-cmis/pom.xml
|
|
profiles: all-tas-tests,run-cmis-browser
|
|
compose-file: docker-compose-minimal+transforms.yml
|
|
- testSuite: CMIS (ATOM binding)
|
|
pom: tests/tas-cmis/pom.xml
|
|
profiles: all-tas-tests,run-cmis-atom
|
|
compose-file: docker-compose-minimal+transforms.yml
|
|
- testSuite: CMIS (WEBSERVICES binding)
|
|
pom: tests/tas-cmis/pom.xml
|
|
profiles: all-tas-tests,run-cmis-webservices
|
|
compose-file: docker-compose-minimal+transforms.yml
|
|
- testSuite: Email
|
|
pom: tests/tas-email/pom.xml
|
|
profiles: all-tas-tests
|
|
compose-file: docker-compose-minimal.yml
|
|
- testSuite: WebDAV
|
|
pom: tests/tas-webdav/pom.xml
|
|
profiles: all-tas-tests
|
|
compose-file: docker-compose-minimal.yml
|
|
- testSuite: Integration
|
|
pom: tests/tas-integration/pom.xml
|
|
profiles: all-tas-tests
|
|
compose-file: docker-compose-minimal.yml
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: ./.github/actions/setup-build-tools
|
|
- name: "Init"
|
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
|
run: |
|
|
bash ./scripts/ci/init.sh
|
|
bash ./scripts/ci/build.sh
|
|
- name: "Setup the environment"
|
|
run: |
|
|
${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/${{ matrix.compose-file }}
|
|
${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
|
- name: "Test"
|
|
run: mvn -B install -ntp -f ${{ matrix.pom }} -P${{ matrix.profiles }} -Denvironment=default -DrunBugs=false
|
|
- name: "Clean Maven cache"
|
|
run: bash ./scripts/ci/cleanup_cache.sh
|
|
|
|
community_zip_tests:
|
|
name: Community Distribution Zip content tests
|
|
runs-on: ubuntu-latest
|
|
needs: configure_env
|
|
if: "!contains(github.event.head_commit.message, '[skip tests]')"
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: ./.github/actions/setup-build-tools
|
|
- name: "Init"
|
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
|
run: |
|
|
bash ./scripts/ci/init.sh
|
|
bash ./scripts/ci/build.sh
|
|
- name: "Build"
|
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
|
run: mvn -B -ntp -V clean install -Pags -DskipTests -Dmaven.javadoc.skip=true
|
|
- name: "Test"
|
|
run: mvn -B install -ntp -f tests/tas-distribution-zip/pom.xml -Prun-distribution-zip-contents-check -DrunBugs=false
|
|
- name: "Clean Maven cache"
|
|
run: bash ./scripts/ci/cleanup_cache.sh
|
|
|
|
test_failure:
|
|
name: Test failure
|
|
runs-on: ubuntu-latest
|
|
needs: configure_env
|
|
steps:
|
|
- name: "Fail"
|
|
run: exit 1
|
|
|
|
docker_latest:
|
|
name: Update latest Docker images
|
|
runs-on: ubuntu-latest
|
|
needs: [tas_tests, community_zip_tests, test_failure]
|
|
if: >
|
|
always() &&
|
|
((!contains(github.event.head_commit.message, '[skip docker_latest]') &&
|
|
(github.ref_name == 'master' || contains(github.ref_name, 'release/')) &&
|
|
github.event_name != 'pull_request') || 'true' == 'true')
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: ./.github/actions/setup-build-tools
|
|
- name: "Init"
|
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
|
run: |
|
|
bash ./scripts/ci/init.sh
|
|
bash ./scripts/ci/build.sh
|
|
- name: "Push Docker images"
|
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
|
run: mvn -B -ntp -V clean install -DskipTests -Dmaven.javadoc.skip=true -Pags #-Ppush-docker-images TODO: uncomment once conditional expression is tested
|
|
- name: "Clean Maven cache"
|
|
run: bash ./scripts/ci/cleanup_cache.sh |