forked from JabRef/jabref
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix database tests and enable running using GitHub workflows (JabRef#…
…5676) - fix behavior when no entries have to be inserted during a synch - fix database tests - have dbms test test only one database - DBMS to test is passed via environment variable "DBMS", defaulting to PostgreSQL - add shared information on Canonical BibTeX entry - some code improvement - have checkstyle running on github workflows (not on Travis) - One big workflow for tests - Make allowPublicKeyRetrieval a property of DBMSConnectionProperties (and create a builder for the properties) - Add check-outdated-dependencies as workflow - Add formatting of test results (scripts/after-failure.sh) - Have fetcher tests and GUI tests run after the database tests (because they currently fail) - Update gradle from 6.0.0 to 6.0.1
- Loading branch information
Showing
28 changed files
with
817 additions
and
607 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: Outdated dependencies | ||
labels: code-quality, dependencies | ||
--- | ||
There are outdated dependencies! | ||
See https://github.com/JabRef/jabref/actions?query=is%3Afailure for details. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Check dependencies | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * 0' # Run every Sunday | ||
|
||
jobs: | ||
checkDependencies: | ||
name: Check dependencies | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v1 | ||
with: | ||
depth: 1 | ||
submodules: false | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 13 | ||
- name: Look for outdated dependencies | ||
run: ./gradlew -q checkOutdatedDependencies | ||
- name: Report issues | ||
if: failure() | ||
uses: JasonEtco/create-an-issue@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
filename: .github/outdatedDependencies.md |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,236 @@ | ||
name: Tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
checkstyle: | ||
name: Checkstyle | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v1 | ||
with: | ||
depth: 1 | ||
submodules: false | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 13 | ||
- uses: actions/cache@v1 | ||
name: Restore gradle chache | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: | | ||
${{ runner.OS }}-gradle-${{ env.cache-name }}- | ||
${{ runner.OS }}-gradle- | ||
${{ runner.OS }}- | ||
- uses: actions/cache@v1 | ||
name: Restore gradle wrapper | ||
with: | ||
path: ~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | ||
- name: Run checkstyle | ||
run: ./gradlew checkstyleMain checkstyleTest checkstyleJmh | ||
tests: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v1 | ||
with: | ||
depth: 1 | ||
submodules: false | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 13 | ||
- uses: actions/cache@v1 | ||
name: Restore gradle chache | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: | | ||
${{ runner.OS }}-gradle-${{ env.cache-name }}- | ||
${{ runner.OS }}-gradle- | ||
${{ runner.OS }}- | ||
- uses: actions/cache@v1 | ||
name: Restore gradle wrapper | ||
with: | ||
path: ~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | ||
- name: Run tests | ||
run: xvfb-run --auto-servernum ./gradlew check -x checkstyleJmh -x checkstyleMain -x checkstyleTest | ||
env: | ||
CI: "true" | ||
- name: Format failed test results | ||
if: failure() | ||
run: | | ||
sudo apt-get install -qq -y xml-twig-tools xsltproc | ||
scripts/after-failure.sh | ||
databasetests: | ||
name: Database tests | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:10.8 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: postgres | ||
ports: | ||
- 5432:5432 | ||
# needed because the postgres container does not provide a healthcheck | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v1 | ||
with: | ||
depth: 1 | ||
submodules: false | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 13 | ||
- uses: actions/cache@v1 | ||
name: Restore gradle chache | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: | | ||
${{ runner.OS }}-gradle-${{ env.cache-name }}- | ||
${{ runner.OS }}-gradle- | ||
${{ runner.OS }}- | ||
- uses: actions/cache@v1 | ||
name: Restore gradle wrapper | ||
with: | ||
path: ~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | ||
- name: Run tests on PostgreSQL | ||
run: ./gradlew databaseTest --rerun-tasks | ||
env: | ||
CI: "true" | ||
DBMS: "postgresql" | ||
- name: Shutdown Ubuntu MySQL | ||
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it | ||
- name: Start custom MySQL | ||
uses: mirromutth/mysql-action@v1.1 | ||
with: | ||
host port: 3800 | ||
container port: 3307 | ||
character set server: 'utf8' | ||
collation server: 'utf8_general_ci' | ||
mysql version: '8.0' | ||
mysql database: 'jabref' | ||
mysql root password: 'root' | ||
- name: Run tests on MySQL | ||
run: ./gradlew databaseTest --rerun-tasks | ||
env: | ||
CI: "true" | ||
DBMS: "mysql" | ||
fetchertests: | ||
name: Fetcher tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v1 | ||
with: | ||
depth: 1 | ||
submodules: false | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 13 | ||
- uses: actions/cache@v1 | ||
name: Restore gradle chache | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: | | ||
${{ runner.OS }}-gradle-${{ env.cache-name }}- | ||
${{ runner.OS }}-gradle- | ||
${{ runner.OS }}- | ||
- uses: actions/cache@v1 | ||
name: Restore gradle wrapper | ||
with: | ||
path: ~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | ||
- name: Run fetcher tests | ||
run: ./gradlew fetcherTest | ||
env: | ||
CI: "true" | ||
guitests: | ||
name: GUI tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v1 | ||
with: | ||
depth: 1 | ||
submodules: false | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 13 | ||
- uses: actions/cache@v1 | ||
name: Restore gradle chache | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: | | ||
${{ runner.OS }}-gradle-${{ env.cache-name }}- | ||
${{ runner.OS }}-gradle- | ||
${{ runner.OS }}- | ||
- uses: actions/cache@v1 | ||
name: Restore gradle wrapper | ||
with: | ||
path: ~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | ||
- name: Run GUI tests | ||
run: xvfb-run --auto-servernum ./gradlew guiTest | ||
env: | ||
CI: "true" | ||
codecoverage: | ||
name: Code coverage | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:10.8 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: postgres | ||
ports: | ||
- 5432:5432 | ||
# needed because the postgres container does not provide a healthcheck | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v1 | ||
with: | ||
depth: 1 | ||
submodules: false | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 13 | ||
- uses: actions/cache@v1 | ||
name: Restore gradle chache | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: | | ||
${{ runner.OS }}-gradle-${{ env.cache-name }}- | ||
${{ runner.OS }}-gradle- | ||
${{ runner.OS }}- | ||
- uses: actions/cache@v1 | ||
name: Restore gradle wrapper | ||
with: | ||
path: ~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | ||
- name: Update test coverage metrics | ||
run: xvfb-run --auto-servernum ./gradlew jacocoTestReport && bash <(curl -s https://codecov.io/bash); | ||
env: | ||
CI: "false" # we pretend to run locally - even if tests fail on the CI, they count towards test coverage | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
DBMS: "postgresql" |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.