Skip to content

Commit

Permalink
build: add js lib tests to ci (#1577)
Browse files Browse the repository at this point in the history
  • Loading branch information
subotic committed Feb 27, 2020
1 parent 3327c3b commit 87f1898
Show file tree
Hide file tree
Showing 18 changed files with 320 additions and 116 deletions.
119 changes: 79 additions & 40 deletions .github/workflows/main.yml
Expand Up @@ -3,7 +3,7 @@ name: CI
on: [push]

env:
KNORA_GDB_LICENSE: ${{ github.workspace }}/ci/graphdb.license
KNORA_GDB_LICENSE: ${{ github.workspace }}/ci/graphdb/UNIBAS_DEV_GRAPHDB_SE_latest-31-12-2020_1cores.license

jobs:
compile:
Expand Down Expand Up @@ -54,9 +54,16 @@ jobs:
needs: compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Checkout source
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Checkout private ci-assets
uses: actions/checkout@v2
with:
repository: dasch-swiss/dsp-ci-assets
token: ${{ secrets.GitHub_PAT }} # `GitHub_PAT` is a secret that contains the PAT.
path: ci
- name: cache maven artifacts
uses: actions/cache@v1
with:
Expand All @@ -66,26 +73,28 @@ jobs:
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: prepare needed graphdb-se files
run: |
echo ${{ secrets.license_encryption_key }} | gpg --quiet --batch --yes --decrypt --passphrase-fd 0 --output $GITHUB_WORKSPACE/ci/secrets.tar $GITHUB_WORKSPACE/ci/secrets.tar.gpg
tar -C ci -xvf ci/secrets.tar
mkdir -p $GITHUB_WORKSPACE/graphdb
cp $GITHUB_WORKSPACE/ci/graphdb.license $GITHUB_WORKSPACE/graphdb/graphdb.license
cp $GITHUB_WORKSPACE/webapi/scripts/KnoraRules.pie $GITHUB_WORKSPACE/graphdb
- name: Print env file
run: make print-env-file
run: |
make env-file
make print-env-file
- name: Run API unit tests
run: make unit-tests-with-coverage
run: make test-unit-ci

api-e2e-tests:
name: API E2E Tests
needs: compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Checkout source
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Checkout private ci-assets
uses: actions/checkout@v2
with:
repository: dasch-swiss/dsp-ci-assets
token: ${{ secrets.GitHub_PAT }} # `GitHub_PAT` is a secret that contains the PAT.
path: ci
- name: cache maven artifacts
uses: actions/cache@v1
with:
Expand All @@ -95,26 +104,28 @@ jobs:
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: prepare needed graphdb-se files
run: |
echo ${{ secrets.license_encryption_key }} | gpg --quiet --batch --yes --decrypt --passphrase-fd 0 --output $GITHUB_WORKSPACE/ci/secrets.tar $GITHUB_WORKSPACE/ci/secrets.tar.gpg
tar -C ci -xvf ci/secrets.tar
mkdir -p $GITHUB_WORKSPACE/graphdb
cp $GITHUB_WORKSPACE/ci/graphdb.license $GITHUB_WORKSPACE/graphdb/graphdb.license
cp $GITHUB_WORKSPACE/webapi/scripts/KnoraRules.pie $GITHUB_WORKSPACE/graphdb
- name: print env file
run: make print-env-file
run: |
make env-file
make print-env-file
- name: run API E2E tests
run: make e2e-tests-with-coverage
run: make test-e2e-ci

api-integration-tests:
name: API Integration Tests
needs: compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Checkout source
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Checkout private ci-assets
uses: actions/checkout@v2
with:
repository: dasch-swiss/dsp-ci-assets
token: ${{ secrets.GitHub_PAT }} # `GitHub_PAT` is a secret that contains the PAT.
path: ci
- name: cache maven artifacts
uses: actions/cache@v1
with:
Expand All @@ -124,17 +135,45 @@ jobs:
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: prepare needed graphdb-se files
run: |
echo ${{ secrets.license_encryption_key }} | gpg --quiet --batch --yes --decrypt --passphrase-fd 0 --output $GITHUB_WORKSPACE/ci/secrets.tar $GITHUB_WORKSPACE/ci/secrets.tar.gpg
tar -C ci -xvf ci/secrets.tar
mkdir -p $GITHUB_WORKSPACE/graphdb
cp $GITHUB_WORKSPACE/ci/graphdb.license $GITHUB_WORKSPACE/graphdb/graphdb.license
cp $GITHUB_WORKSPACE/webapi/scripts/KnoraRules.pie $GITHUB_WORKSPACE/graphdb
- name: print env file
run: make print-env-file
run: |
make env-file
make print-env-file
- name: run API integration tests
run: make it-tests-with-coverage
run: make test-it-ci

js-lib-tests:
name: JS Lib Tests
needs: compile
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Checkout private ci-assets
uses: actions/checkout@v2
with:
repository: dasch-swiss/dsp-ci-assets
token: ${{ secrets.GitHub_PAT }} # `GitHub_PAT` is a secret that contains the PAT.
path: ci
- name: cache maven artifacts
uses: actions/cache@v1
with:
path: ~/.ivy2
key: ${{ runner.OS }}-build-${{ hashFiles('**/KnoraBuild.sbt') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: install requirements
run: sudo apt-get install expect
- name: print env file
run: |
make env-file
make print-env-file
- name: run JS lib tests
run: make test-js-lib-integration

upgrade-unit-tests:
name: Upgrade Unit Tests
Expand All @@ -161,9 +200,16 @@ jobs:
needs: compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Checkout source
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Checkout private ci-assets
uses: actions/checkout@v2
with:
repository: dasch-swiss/dsp-ci-assets
token: ${{ secrets.GitHub_PAT }} # `GitHub_PAT` is a secret that contains the PAT.
path: ci
- uses: actions/setup-java@v1
with:
java-version: '11.x.x'
Expand All @@ -182,17 +228,10 @@ jobs:
run: |
make build-all-scala
make build-all-images
- name: prepare needed graphdb-se files
run: |
echo ${{ secrets.license_encryption_key }} | gpg --quiet --batch --yes --decrypt --passphrase-fd 0 --output $GITHUB_WORKSPACE/ci/secrets.tar $GITHUB_WORKSPACE/ci/secrets.tar.gpg
tar -C ci -xvf ci/secrets.tar
mkdir -p $GITHUB_WORKSPACE/graphdb
cp $GITHUB_WORKSPACE/ci/graphdb.license $GITHUB_WORKSPACE/graphdb/graphdb.license
cp $GITHUB_WORKSPACE/webapi/scripts/KnoraRules.pie $GITHUB_WORKSPACE/graphdb
- name: start and initialize graphdb-se
run: |
docker network create knora-net
docker run --rm -d --name=db --network=knora-net -p 127.0.0.1:7200:7200 -v $GITHUB_WORKSPACE/ci/graphdb.license:/graphdb/graphdb.license -e GDB_HEAP_SIZE=$GDB_HEAP_SIZE daschswiss/knora-graphdb-se -Dgraphdb.license.file=/graphdb/graphdb.license
docker run --rm -d --name=db --network=knora-net -p 127.0.0.1:7200:7200 -e GDB_HEAP_SIZE=$GDB_HEAP_SIZE daschswiss/knora-graphdb-se -Dgraphdb.license.file=/graphdb/graphdb.license
sleep 5
make init-db-test-minimal
- name: unzip test data
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -12,6 +12,7 @@
.ensime
.ensime_cache
.env
/.tmp/
native
**/.DS_Store
docs/env
Expand Down

0 comments on commit 87f1898

Please sign in to comment.