Skip to content

Integration Test

Integration Test #750

Workflow file for this run

name: 'Integration Test'
on:
workflow_dispatch:
schedule:
# When updating the cron schedule here, be sure to also change the user from
# `github.actor` to either `github.repository_owner` or a hard-coded value.
#
# This is because the latest user who creates the schedule trigger will be
# the actor for the schedule workflow, see
# <https://github.com/orgs/community/discussions/25067> for more details.
- cron: 30 16 * * * # 16:30 UTC (19:30 MSK), daily.
jobs:
test:
name: 'Integration Test'
runs-on: ubuntu-latest
# A possible workaround for <https://github.com/dorny/test-reporter/issues/168>.
permissions:
checks: write
contents: write
pull-requests: write
statuses: write
steps:
- uses: actions/checkout@v4
- name: 'Set up Java 17'
uses: actions/setup-java@v4
with:
java-version: 17
distribution: zulu
java-package: jdk+fx
cache: gradle
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: 'Execute Gradle build'
uses: gradle/gradle-build-action@v3
with:
gradle-version: wrapper
arguments: |
-Dsave-cloud.backend.url=https://saveourtool.com
-Dsave-cloud.user=${{ secrets.SAVE_CLOUD_USER }}
-Dsave-cloud.password=${{ secrets.SAVE_CLOUD_PASSWORD }}
-Dsave-cloud.project.name=Diktat-Integration
-Dsave-cloud.contest.name=Integration-Tests
-Dsave-cloud.test.version=save-integration-test
build
# This step needs a Git repository, so it's impossible to extract it
# into a separate job (or, otherwise, we'd need to upload the content
# of the whole `.git` folder as an artifact).
- name: 'JUnit Tests (dorny/test-reporter)'
uses: dorny/test-reporter@v1
if: ${{ always() }}
with:
name: 'JUnit Tests (dorny/test-reporter)'
# Comma-separated values.
path: "**/build/test-results/*/TEST-*.xml"
reporter: java-junit
# Ignore the "Resource not accessible by integration" error when a PR
# originates from a non-collaborator. This is
# <https://github.com/dorny/test-reporter/issues/168> which may be
# potentially fixed with <https://github.com/dorny/test-reporter/pull/174>.
continue-on-error: true
- name: 'Upload test results'
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: xml-test-reports
path: |
**/build/test-results/*/TEST-*.xml
retention-days: 1
report:
name: 'Publish JUnit test results'
if: ${{ always() }}
needs: test
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- uses: actions/download-artifact@v4
if: ${{ always() }}
with:
name: xml-test-reports
# Uses Docker, that's why Linux-only.
- name: 'JUnit Tests (EnricoMi/publish-unit-test-result-action)'
uses: EnricoMi/publish-unit-test-result-action@v2
with:
check_name: 'JUnit Tests (EnricoMi/publish-unit-test-result-action)'
files: |
**/build/test-results/*/TEST-*.xml