-
Notifications
You must be signed in to change notification settings - Fork 31
140 lines (133 loc) · 5.26 KB
/
ci-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#####################################################################
# 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