2021-01-04 12:28:48 +01:00
|
|
|
name: Continuous Integration
|
2020-12-04 08:50:10 +01:00
|
|
|
|
2021-01-08 18:21:02 +01:00
|
|
|
on:
|
2021-04-22 07:51:59 +02:00
|
|
|
pull_request_target:
|
2021-01-08 18:21:02 +01:00
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
2020-12-04 08:50:10 +01:00
|
|
|
|
2021-04-22 08:04:39 +02:00
|
|
|
permissions: read-all
|
|
|
|
|
2020-12-04 08:50:10 +01:00
|
|
|
jobs:
|
2021-01-04 12:28:48 +01:00
|
|
|
server_tests:
|
2020-12-07 05:36:05 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
java: [ 8, 14 ]
|
2020-12-04 08:50:10 +01:00
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres
|
|
|
|
ports:
|
|
|
|
- 5432
|
|
|
|
env:
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
POSTGRES_PASSWORD: 'postgres'
|
|
|
|
POSTGRES_DB: test_db
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
mysql:
|
|
|
|
image: mysql:8
|
|
|
|
ports:
|
|
|
|
- 3306
|
|
|
|
env:
|
|
|
|
MYSQL_ROOT_PASSWORD: root
|
|
|
|
options: >-
|
|
|
|
--health-cmd "mysqladmin ping"
|
|
|
|
--health-interval 5s
|
|
|
|
--health-timeout 2s
|
|
|
|
--health-retries 3
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2.3.4
|
2021-01-16 12:01:55 +01:00
|
|
|
with:
|
2021-02-05 12:56:31 +01:00
|
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
2021-01-16 12:01:55 +01:00
|
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
2020-12-04 08:50:10 +01:00
|
|
|
|
|
|
|
- name: Restore dependency cache
|
2021-04-14 22:07:23 +02:00
|
|
|
uses: actions/cache@v2.1.5
|
2020-12-04 08:50:10 +01:00
|
|
|
with:
|
|
|
|
path: ~/.m2/repository
|
|
|
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-maven-
|
|
|
|
|
2020-12-07 05:36:05 +01:00
|
|
|
- name: Set up Java ${{ matrix.java }}
|
2021-04-06 15:18:15 +02:00
|
|
|
uses: actions/setup-java@v2
|
2020-12-04 08:50:10 +01:00
|
|
|
with:
|
2021-04-09 07:35:05 +02:00
|
|
|
distribution: 'adopt'
|
2020-12-07 05:36:05 +01:00
|
|
|
java-version: ${{ matrix.java }}
|
2020-12-04 08:50:10 +01:00
|
|
|
|
|
|
|
- name: Configure connections to databases
|
|
|
|
id: configure_db_connections
|
|
|
|
run: cat extensions/database/tests/conf/github_actions_tests.xml | sed -e "s/MYSQL_PORT/${{ job.services.mysql.ports[3306] }}/g" | sed -e "s/POSTGRES_PORT/${{ job.services.postgres.ports[5432] }}/g" > extensions/database/tests/conf/tests.xml
|
|
|
|
|
|
|
|
- name: Populate databases with test data
|
|
|
|
id: populate_databases_with_test_data
|
|
|
|
run: |
|
|
|
|
mysql -u root -h 127.0.0.1 -P ${{ job.services.mysql.ports[3306] }} -proot -e 'CREATE DATABASE test_db;'
|
|
|
|
mysql -u root -h 127.0.0.1 -P ${{ job.services.mysql.ports[3306] }} -proot < extensions/database/tests/conf/test-mysql.sql
|
|
|
|
psql -U postgres test_db -h 127.0.0.1 -p ${{ job.services.postgres.ports[5432] }} < extensions/database/tests/conf/test-pgsql.sql
|
|
|
|
env:
|
|
|
|
PGPASSWORD: postgres
|
|
|
|
|
|
|
|
- name: Build and test with Maven
|
|
|
|
run: mvn jacoco:prepare-agent test
|
|
|
|
|
|
|
|
- name: Submit test coverage to Coveralls
|
|
|
|
run: |
|
|
|
|
mvn prepare-package -DskipTests=true
|
|
|
|
mvn jacoco:report coveralls:report -DrepoToken=${{ secrets.COVERALLS_TOKEN }} -DpullRequest=${{ github.event.number }}
|
2021-01-04 12:28:48 +01:00
|
|
|
|
|
|
|
ui_tests:
|
2020-12-15 20:34:15 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
browser: ['chrome']
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2.3.4
|
2021-01-16 12:01:55 +01:00
|
|
|
with:
|
2021-02-05 12:56:26 +01:00
|
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
2021-01-16 12:01:55 +01:00
|
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
2020-12-15 20:34:15 +01:00
|
|
|
|
|
|
|
- name: Restore dependency cache
|
2021-04-14 22:07:23 +02:00
|
|
|
uses: actions/cache@v2.1.5
|
2020-12-15 20:34:15 +01:00
|
|
|
with:
|
|
|
|
path: ~/.m2/repository
|
|
|
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-maven-
|
|
|
|
|
|
|
|
- name: Set up Java 8
|
2021-04-06 15:18:15 +02:00
|
|
|
uses: actions/setup-java@v2
|
2020-12-15 20:34:15 +01:00
|
|
|
with:
|
2021-04-08 22:31:08 +02:00
|
|
|
distribution: 'adopt'
|
2020-12-15 20:34:15 +01:00
|
|
|
java-version: 8
|
|
|
|
|
|
|
|
- name: Build OpenRefine
|
|
|
|
run: ./refine build
|
|
|
|
|
2021-01-08 18:21:02 +01:00
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: '12'
|
|
|
|
|
2020-12-15 20:34:15 +01:00
|
|
|
- name: Restore Tests dependency cache
|
2021-04-14 22:07:23 +02:00
|
|
|
uses: actions/cache@v2.1.5
|
2020-12-15 20:34:15 +01:00
|
|
|
with:
|
2021-01-08 18:21:02 +01:00
|
|
|
path: |
|
|
|
|
~/cache
|
|
|
|
~/.cache
|
|
|
|
**/node_modules
|
|
|
|
!~/cache/exclude
|
2020-12-15 20:34:15 +01:00
|
|
|
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-yarn
|
|
|
|
|
|
|
|
- name: Install test dependencies
|
|
|
|
run: |
|
|
|
|
cd ./main/tests/cypress
|
2021-01-08 18:21:02 +01:00
|
|
|
npm i -g yarn
|
2020-12-15 20:34:15 +01:00
|
|
|
yarn install
|
|
|
|
|
2021-02-11 19:52:48 +01:00
|
|
|
- name: Lint with ES-Lint & Prettier
|
2021-02-04 15:37:03 +01:00
|
|
|
run: |
|
|
|
|
cd ./main/tests/cypress
|
2021-02-10 14:18:49 +01:00
|
|
|
yarn lint
|
2021-02-04 15:37:03 +01:00
|
|
|
|
2020-12-15 20:34:15 +01:00
|
|
|
- name: Test with Cypress on ${{ matrix.browser }}
|
|
|
|
run: |
|
|
|
|
echo REFINE_MIN_MEMORY=1400M >> ./refine.ini
|
|
|
|
echo REFINE_MEMORY=4096M >> ./refine.ini
|
2021-04-22 07:51:59 +02:00
|
|
|
./refine ui_test ${{ matrix.browser }} s5du3k "${{ secrets.CYPRESS_RECORD_KEY }}"
|
|
|
|
|