Merge pull request #234 from xenit-eu/DOCKER-472 #2212
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'Continuous Integration' | |
| on: | |
| push: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '7 0 * * SUN' | |
| env: | |
| GRADLE_OPTS: >- | |
| -Dorg.gradle.project.org.alfresco.maven.nexus.username=${{ secrets.ALFRESCO_NEXUS_USERNAME }} | |
| -Dorg.gradle.project.org.alfresco.maven.nexus.password=${{ secrets.ALFRESCO_NEXUS_PASSWORD }} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4.7.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Unit tests | |
| uses: gradle/gradle-build-action@v3.5.0 | |
| with: | |
| cache-read-only: false | |
| arguments: test --parallel --info | |
| - name: Upload analysis to sonarcloud | |
| uses: gradle/gradle-build-action@v3.5.0 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| cache-read-only: false | |
| arguments: sonarqube -i | |
| - name: Upload test artifact | |
| if: success() || failure() | |
| uses: actions/upload-artifact@v4.6.0 | |
| with: | |
| name: test-result | |
| path: /home/runner/work/**/build/reports | |
| retention-days: 2 | |
| integration-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: [ "community-7.0.0", "community-7.1.1", "community-7.2.0", "community-7.3.0", "community-7.4.0", "community-23.1.0", "community-23.2.0", "community-23.3.0", "community-23.4.0", "community-25.1.0", "enterprise-7.0.1", "enterprise-7.1.0", "enterprise-7.2.0", "enterprise-7.3.0", "enterprise-7.4.0", "enterprise-23.1.0", "enterprise-23.2.0", "enterprise-23.3.0", "enterprise-23.4.0", "enterprise-23.5.1", "enterprise-23.6.0", "enterprise-25.1.0"] | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4.7.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Login to docker registry | |
| run: echo '${{ secrets.HARBOR_PASSWORD }}' | docker login docker.xenit.eu --username '${{ secrets.HARBOR_USER }}' --password-stdin | |
| - name: Integration tests | |
| uses: gradle/gradle-build-action@v3.5.0 | |
| with: | |
| cache-read-only: false | |
| arguments: :2repository:${{ matrix.version }}:integrationTests --info --stacktrace | |
| - name: Upload test artifact | |
| if: success() || failure() | |
| uses: actions/upload-artifact@v4.6.0 | |
| with: | |
| name: integration-test-${{ matrix.version }}-result | |
| path: /home/runner/work/**/build/reports | |
| retention-days: 2 | |
| publish-docker-images: | |
| needs: [ test, integration-test ] | |
| runs-on: ubuntu-latest | |
| if: ${{ startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/tags/v') }} | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4.7.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Login to docker registry | |
| run: echo '${{ secrets.HARBOR_PASSWORD }}' | docker login docker.xenit.eu --username '${{ secrets.HARBOR_USER }}' --password-stdin | |
| # We have to split out publishing to public and private repo's because pushing to docker.io does not seem to work | |
| # without supplying DOCKER_USER and DOCKER_PASSWORD. However, supplying those environment variables breaks | |
| # publishing to other repositories | |
| - name: Publish public docker images | |
| env: | |
| DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
| DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
| uses: gradle/gradle-build-action@v3.5.0 | |
| with: | |
| cache-read-only: false | |
| arguments: pushDockerImage -PincludeEnterprise=false | |
| - name: Publish private docker images | |
| uses: gradle/gradle-build-action@v3.5.0 | |
| with: | |
| cache-read-only: false | |
| arguments: :2repository:pushDockerImage -PincludeCommunity=false | |
| publish-maven-images: | |
| needs: [ test, integration-test ] | |
| runs-on: ubuntu-latest | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4.7.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Publish tomcat base jars | |
| env: | |
| ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVEN_CENTRAL_GPG_KEY }} | |
| ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MAVEN_CENTRAL_GPG_PASSWORD }} | |
| ORG_GRADLE_PROJECT_sonatype_username: ${{ secrets.SONATYPE_S01_USERNAME }} | |
| ORG_GRADLE_PROJECT_sonatype_password: ${{ secrets.SONATYPE_S01_PASSWORD }} | |
| uses: gradle/gradle-build-action@v3.5.0 | |
| with: | |
| cache-read-only: false | |
| arguments: :tomcat-base:tomcat-embedded-9:publish :tomcat-base:tomcat-embedded-10:publish --info -PsigningKeyId=CDE3528F |