Integration Tests #6476
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
##################################################################### | |
# Integration test suite definition for IRIDA using GitHub Actions | |
##################################################################### | |
name: Integration Tests | |
on: | |
pull_request: # Run on all pull requests | |
push: | |
branches: # Run on any push to development or main | |
- development | |
- main | |
schedule: # Run daily on development and weekly on main | |
- cron: 0 1 * * * | |
branches: development | |
- cron: 0 2 * * 0 | |
branches: main | |
jobs: | |
gradle-build: # Gradle integration tests | |
timeout-minutes: 60 | |
runs-on: ubuntu-20.04 #See pre-installed software at https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md | |
env: | |
MYSQL_PORT: 3800 | |
MYSQL_USER: test | |
MYSQL_PASSWORD: test | |
MYSQL_DATABASE: irida_integration_test | |
MYSQL_HOST: 127.0.0.1 | |
strategy: | |
fail-fast: false #Setting so that if one of the test suites fail, the other will continue | |
matrix: | |
#The list of test suites to run | |
suite: | |
[ | |
"service_testing", | |
"rest_testing", | |
"ui_testing", | |
"galaxy_testing", | |
"galaxy_pipeline_testing", | |
"open_api_testing", | |
"file_system_testing", | |
] | |
steps: | |
- uses: actions/checkout@v3 #Checkout the project from git | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "::set-output name=pnpm_cache_dir::$(./gradlew pnpmCacheDir -q)" | |
- name: Setup pnpm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Setup MySQL | |
uses: mirromutth/[email protected] | |
with: | |
host port: ${{ env.MYSQL_PORT }} | |
character set server: "utf8" | |
collation server: "utf8_general_ci" | |
mysql version: "5.7" | |
mysql database: ${{ env.MYSQL_DATABASE }} | |
mysql user: ${{ env.MYSQL_USER }} | |
mysql password: ${{ env.MYSQL_PASSWORD }} | |
- name: Set up JDK 11 # Installs java 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Wait for MySQL | |
run: | | |
while ! mysqladmin ping --host=${{ env.MYSQL_HOST }} --port=${{ env.MYSQL_PORT }} --user=${{ env.MYSQL_USER }} --password=${{ env.MYSQL_ROOT_PASSWORD }} --silent; do | |
sleep 1 | |
done | |
- name: Run tests with Gradle # Run the test suite | |
run: ./run-tests.sh --db-host ${{ env.MYSQL_HOST }} --db-port ${{ env.MYSQL_PORT }} --database ${{ env.MYSQL_DATABASE}} ${{ matrix.suite }} | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v3 | |
if: matrix.suite != 'open_api_testing' && always() | |
with: | |
report_paths: "**/build/test-results/*ITest/TEST-*.xml" # Publish Integration Test results | |
fail_on_failure: false | |
check_name: "JUnit Test Report (${{ matrix.suite }})" | |
annotate_only: true | |
docs-build: # Testing the javadoc and jekyll documentation builds | |
runs-on: ubuntu-20.04 | |
env: | |
MYSQL_PORT: 3800 | |
MYSQL_USER: test | |
MYSQL_PASSWORD: test | |
MYSQL_DATABASE: irida_integration_test | |
MYSQL_HOST: 127.0.0.1 | |
steps: | |
- uses: actions/checkout@v4 #Checkout the project from git | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "::set-output name=pnpm_cache_dir::$(./gradlew pnpmCacheDir -q)" | |
- name: Setup pnpm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Setup MySQL | |
uses: mirromutth/[email protected] | |
with: | |
host port: ${{ env.MYSQL_PORT }} | |
character set server: "utf8" | |
collation server: "utf8_general_ci" | |
mysql version: "5.7" | |
mysql database: ${{ env.MYSQL_DATABASE }} | |
mysql user: ${{ env.MYSQL_USER }} | |
mysql password: ${{ env.MYSQL_PASSWORD }} | |
- name: Setup Ruby | |
uses: actions/setup-ruby@v1 | |
- name: Set up JDK 11 # Installs java 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Wait for MySQL | |
run: | | |
while ! mysqladmin ping --host=${{ env.MYSQL_HOST }} --port=${{ env.MYSQL_PORT }} --user=${{ env.MYSQL_USER }} --password=${{ env.MYSQL_ROOT_PASSWORD }} --silent; do | |
sleep 1 | |
done | |
- name: Build Documentation Site | |
run: ./gradlew clean buildDocsSite -Dliquibase.update.database.schema=true -Dspring.datasource.url=jdbc:mysql://${{env.MYSQL_HOST}}:${{env.MYSQL_PORT}}/${{env.MYSQL_DATABASE}} -Dspring.datasource.dbcp2.max-wait=10000 |