2020-12-04 08:50:10 +01:00
|
|
|
name: Snapshot release
|
2020-01-28 18:06:00 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-03-20 14:45:26 +01:00
|
|
|
branches:
|
2021-02-02 10:04:26 +01:00
|
|
|
- 'master'
|
2021-12-09 17:14:14 +01:00
|
|
|
- '4.0'
|
2021-02-02 10:04:26 +01:00
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
2020-01-28 18:06:00 +01:00
|
|
|
|
|
|
|
jobs:
|
2021-05-27 15:18:20 +02:00
|
|
|
prepare_ui_test_matrix:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2.3.4
|
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
|
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: '12'
|
|
|
|
- id: set-matrix
|
|
|
|
run: npm install --save glob && node main/tests/cypress/build-test-matrix.js
|
|
|
|
env:
|
2021-09-17 09:10:32 +02:00
|
|
|
browsers: chrome
|
2021-05-27 15:18:20 +02:00
|
|
|
ui_test:
|
|
|
|
needs: prepare_ui_test_matrix
|
2020-12-15 20:34:15 +01:00
|
|
|
runs-on: ubuntu-latest
|
2020-12-16 09:51:18 +01:00
|
|
|
strategy:
|
2021-05-27 15:18:20 +02:00
|
|
|
matrix: ${{fromJSON(needs.prepare_ui_test_matrix.outputs.matrix)}}
|
2020-12-15 20:34:15 +01:00
|
|
|
steps:
|
2021-05-27 15:18:20 +02:00
|
|
|
- uses: actions/checkout@v2.3.4
|
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
|
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
2020-12-15 20:34:15 +01:00
|
|
|
|
2021-05-27 15:18:20 +02:00
|
|
|
- name: Restore dependency cache
|
2021-11-23 19:56:10 +01:00
|
|
|
uses: actions/cache@v2.1.7
|
2021-05-27 15:18:20 +02:00
|
|
|
with:
|
2020-12-15 20:34:15 +01:00
|
|
|
path: ~/.m2/repository
|
|
|
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
|
|
restore-keys: |
|
2021-05-27 15:18:20 +02:00
|
|
|
${{ runner.os }}-maven-
|
2020-12-15 20:34:15 +01:00
|
|
|
|
2021-11-07 11:43:12 +01:00
|
|
|
- name: Set up Java 11
|
2021-05-27 15:18:20 +02:00
|
|
|
uses: actions/setup-java@v2
|
|
|
|
with:
|
2021-04-08 22:31:08 +02:00
|
|
|
distribution: 'adopt'
|
2021-11-07 11:43:12 +01:00
|
|
|
java-version: 11
|
2020-12-15 20:34:15 +01:00
|
|
|
|
2021-05-27 15:18:20 +02:00
|
|
|
- name: Build OpenRefine
|
|
|
|
run: ./refine build
|
2021-01-14 18:21:34 +01:00
|
|
|
|
2021-05-27 15:18:20 +02:00
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: '12'
|
2020-12-16 09:51:18 +01:00
|
|
|
|
2021-05-27 15:18:20 +02:00
|
|
|
- name: Restore Tests dependency cache
|
2021-11-23 19:56:10 +01:00
|
|
|
uses: actions/cache@v2.1.7
|
2021-05-27 15:18:20 +02:00
|
|
|
with:
|
2021-01-14 18:21:34 +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: |
|
2021-05-27 15:18:20 +02:00
|
|
|
${{ runner.os }}-yarn
|
2020-12-15 20:34:15 +01:00
|
|
|
|
2021-05-27 15:18:20 +02:00
|
|
|
- name: Install test dependencies
|
|
|
|
run: |
|
2020-12-15 20:34:15 +01:00
|
|
|
cd ./main/tests/cypress
|
2021-01-14 18:21:34 +01:00
|
|
|
npm i -g yarn
|
2020-12-15 20:34:15 +01:00
|
|
|
yarn install
|
|
|
|
|
2021-05-27 15:18:20 +02:00
|
|
|
- name: Test with Cypress on ${{ matrix.browser }}
|
|
|
|
run: |
|
|
|
|
echo REFINE_MIN_MEMORY=1400M >> ./refine.ini
|
|
|
|
echo REFINE_MEMORY=4096M >> ./refine.ini
|
|
|
|
./refine ui_tests
|
|
|
|
env:
|
|
|
|
CYPRESS_BROWSER: ${{ matrix.browser }}
|
|
|
|
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
|
|
|
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
|
|
|
|
CYPRESS_CI_BUILD_ID: '${{ github.run_id }}'
|
|
|
|
CYPRESS_SPECS: ${{ matrix.specs }}
|
2021-02-14 19:55:55 +01:00
|
|
|
|
2020-12-15 20:34:15 +01:00
|
|
|
|
2020-01-28 18:06:00 +01:00
|
|
|
build:
|
|
|
|
|
2020-12-07 05:36:05 +01:00
|
|
|
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
|
|
|
|
|
2020-01-28 18:06:00 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2020-11-09 11:24:13 +01:00
|
|
|
- uses: actions/checkout@v2.3.4
|
2020-11-29 04:00:03 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 0 # This is wasteful, but needed for git describe
|
2020-01-28 18:06:00 +01:00
|
|
|
|
2020-03-23 15:43:02 +01:00
|
|
|
- name: Restore dependency cache
|
2021-11-23 19:56:10 +01:00
|
|
|
uses: actions/cache@v2.1.7
|
2020-03-23 15:43:02 +01:00
|
|
|
with:
|
|
|
|
path: ~/.m2/repository
|
|
|
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-maven-
|
|
|
|
|
2021-11-07 11:43:12 +01:00
|
|
|
- name: Set up Java 11
|
2021-04-06 15:18:15 +02:00
|
|
|
uses: actions/setup-java@v2
|
2020-01-28 18:06:00 +01:00
|
|
|
with:
|
2021-04-09 07:35:05 +02:00
|
|
|
distribution: 'adopt'
|
2021-11-07 11:43:12 +01:00
|
|
|
java-version: 11
|
2021-12-09 16:58:07 +01:00
|
|
|
server-id: ossrh
|
2021-12-09 14:39:54 +01:00
|
|
|
server-username: OSSRH_USER
|
|
|
|
server-password: OSSRH_PASS
|
2020-01-28 18:06:00 +01:00
|
|
|
|
2020-03-23 15:43:02 +01:00
|
|
|
- name: Install genisoimage and jq
|
|
|
|
run: sudo apt-get install genisoimage jq
|
2020-01-28 18:06:00 +01:00
|
|
|
|
2020-12-07 05:36:05 +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
|
|
|
|
|
2020-12-04 08:50:10 +01:00
|
|
|
- name: Build and test with Maven
|
2020-12-07 05:36:05 +01:00
|
|
|
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 }} -DserviceName="GitHub Actions" -DserviceBuildNumber=${{ env.GITHUB_RUN_ID }} -Dbranch=master
|
2020-01-28 18:06:00 +01:00
|
|
|
|
|
|
|
- name: Generate dist files
|
2021-12-09 14:55:59 +01:00
|
|
|
run: mvn package -DskipTests=true
|
2020-01-28 18:06:00 +01:00
|
|
|
|
2021-12-09 14:39:54 +01:00
|
|
|
- name: Upload snapshot releases to OSSRH
|
|
|
|
run: mvn deploy -DskipTests=true
|
2021-12-09 16:58:07 +01:00
|
|
|
env:
|
|
|
|
OSSRH_USER: ${{ secrets.OSSRH_USER }}
|
|
|
|
OSSRH_PASS: ${{ secrets.OSSRH_PASS }}
|
2020-06-16 23:26:41 +02:00
|
|
|
|