Continuous Integration #436
This file contains 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.eu.xenit.cloudsmith.username=${{ secrets.CLOUDSMITH_USER }} | |
-Dorg.gradle.project.eu.xenit.cloudsmith.password=${{ secrets.CLOUDSMITH_APIKEY }} | |
jobs: | |
integration-test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- solr6 | |
task: | |
- integrationTestDefault | |
- integrationTestSharded | |
- integrationTestShardedNonSsl | |
- integrationTestNonSsl | |
- integrationTestMounts | |
- integrationTestXenitEndpoints | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: 1.11 | |
- name: Add license | |
run: | | |
touch ./src/integrationTest/resources/license61/license.lic | |
echo ${{secrets.ALFRESCO_LICENSE61}} > ./src/integrationTest/resources/license61/license.lic | |
chmod 666 ./src/integrationTest/resources/license61/license.lic | |
- name: Login to Docker | |
run: | | |
echo "${{ secrets.CLOUDSMITH_APIKEY }}" | docker login private.docker.xenit.eu --username "${{ secrets.CLOUDSMITH_USER }}" --password-stdin | |
- name: Integration tests | |
uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c # v2 | |
env: | |
VERSIONS_TO_BUILD: ${{ matrix.version }} | |
with: | |
cache-read-only: false | |
arguments: ${{ matrix.task }} --info | |
- name: Upload Artifact | |
if: success() || failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.task }}-result | |
path: /home/runner/work/**/build/reports | |
retention-days: 2 | |
publish: | |
needs: [ integration-test ] | |
runs-on: ubuntu-latest | |
if: ${{ startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/heads/release') }} | |
strategy: | |
matrix: | |
version: | |
- solr6 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Login to CloudSmith | |
run: | | |
echo "${{ secrets.CLOUDSMITH_APIKEY }}" | docker login private.docker.xenit.eu --username "${{ secrets.CLOUDSMITH_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 | |
uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c # v2 | |
env: | |
DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
VERSIONS_TO_BUILD: ${{ matrix.version }} | |
with: | |
cache-read-only: false | |
arguments: pushDockerImage -PincludeEnterprise=false | |
- name: Publish private docker images | |
uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c # v2 | |
env: | |
VERSIONS_TO_BUILD: ${{ matrix.version }} | |
with: | |
cache-read-only: false | |
arguments: pushDockerImage -PincludeCommunity=false |