Skip to content

Commit

Permalink
feat: Integrate github CI and move few build pipelines from Travis (#205
Browse files Browse the repository at this point in the history
)
  • Loading branch information
vishal423 authored and sendilkumarn committed Nov 11, 2019
1 parent 72eccb4 commit 7643290
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 7 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/applications.yml
@@ -0,0 +1,78 @@
name: KHipster Generated Applications CI
on: [push, pull_request]
env:
JHI_RUN_APP: 1
JHI_PROTRACTOR: 0
JHI_JDK: 11
JHI_LIB_REPO: https://github.com/jhipster/jhipster.git
JHI_LIB_BRANCH: release
JHI_GEN_REPO: https://github.com/jhipster/generator-jhipster.git
JHI_GEN_BRANCH: v6.4.1
SPRING_OUTPUT_ANSI_ENABLED: ALWAYS
SPRING_JPA_SHOW_SQL: false
JHI_DISABLE_WEBPACK_LOGS: true
JHI_E2E_HEADLESS: true
JHI_SCRIPTS_PATH: generator-jhipster/test-integration/scripts
JHI_SCRIPTS: $HOME/$JHI_SCRIPTS_PATH
KOTLIN_JHI_SCRIPTS: ${{ github.workspace }}/test-integration/scripts
NG_CLI_ANALYTICS: 'false'
JHI_GITHUB_CI: true
jobs:
applications:
name: ${{ matrix.app-type }} application test suite
runs-on: ${{ matrix.os }}
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
node_version: [12.x]
os: [ubuntu-latest]
app-type: [ngx-session-cassandra-fr, ngx-mongodb-kafka-cucumber, ngx-couchbase]
include:
- app-type: ngx-session-cassandra-fr
entity: cassandra
profile: dev
- app-type: ngx-mongodb-kafka-cucumber
entity: mongodb
profile: dev
- app-type: ngx-couchbase
entity: couchbase
profile: prod
env:
JHI_ENTITY: ${{ matrix.entity }}
JHI_APP: ${{ matrix.app-type }}
JHI_PROFILE: ${{ matrix.profile }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- uses: actions/setup-java@v1
with:
java-version: '11.x'
- name: Stop MySQL server
run: sudo /etc/init.d/mysql stop
- name: Config git variables
run: $KOTLIN_JHI_SCRIPTS/04-git-config.sh
- name: Install KHipster
run: $KOTLIN_JHI_SCRIPTS/10-install-jhipster-kotlin.sh
- name: Generate entities
run: $HOME/$JHI_SCRIPTS_PATH/11-generate-entities.sh
- name: Generate project
run: $KOTLIN_JHI_SCRIPTS/12-generate-project-kotlin.sh
- name: Replace version in the generated project
run: $HOME/$JHI_SCRIPTS_PATH/13-replace-version-generated-project.sh
- name: Jhipster Info
run: $HOME/$JHI_SCRIPTS_PATH/14-jhipster-info.sh
- name: Start docker containers
run: $HOME/$JHI_SCRIPTS_PATH/20-docker-compose.sh
- name: Run backend tests
run: $HOME/$JHI_SCRIPTS_PATH/21-tests-backend.sh
- name: Run frontend tests
run: $HOME/$JHI_SCRIPTS_PATH/22-tests-frontend.sh
- name: Package application
run: $HOME/$JHI_SCRIPTS_PATH/23-package.sh
- name: Run e2e tests
run: $HOME/$JHI_SCRIPTS_PATH/24-tests-e2e.sh
- name: Sonar analysis
run: $HOME/$JHI_SCRIPTS_PATH/25-sonar-analyze.sh
37 changes: 37 additions & 0 deletions .github/workflows/generator.yml
@@ -0,0 +1,37 @@
name: KHipster Generator CI
on: [push, pull_request]
env:
JHI_RUN_APP: 1
JHI_PROTRACTOR: 0
JHI_JDK: 11
JHI_LIB_REPO: https://github.com/jhipster/jhipster.git
JHI_LIB_BRANCH: release
JHI_GEN_REPO: https://github.com/jhipster/generator-jhipster.git
JHI_GEN_BRANCH: v6.4.1
SPRING_OUTPUT_ANSI_ENABLED: ALWAYS
SPRING_JPA_SHOW_SQL: false
JHI_DISABLE_WEBPACK_LOGS: true
JHI_E2E_HEADLESS: true
JHI_SCRIPTS: $HOME/generator-jhipster/test-integration/scripts
KOTLIN_JHI_SCRIPTS: ${{ github.workspace }}/test-integration/scripts
JHI_GITHUB_CI: true
JHI_APP: ''
jobs:
kotlin-hipster:
name: KHipster generator unit test suite
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
node_version: [10.x, 12.x]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- name: Config git variables
run: $KOTLIN_JHI_SCRIPTS/04-git-config.sh
- name: Install and execute unit tests
run: $KOTLIN_JHI_SCRIPTS/10-install-jhipster-kotlin.sh
3 changes: 0 additions & 3 deletions .travis.yml
Expand Up @@ -63,9 +63,6 @@ env:
- JHI_APP=ms-ngx-gateway-eureka JHI_ENTITY=sql JHI_WAR=1
- JHI_APP=ms-micro-eureka JHI_ENTITY=micro JHI_WAR=1
- JHI_APP=ms-micro-consul JHI_ENTITY=micro
- JHI_APP=ngx-mongodb-kafka-cucumber JHI_ENTITY=mongodb
- JHI_APP=ngx-session-cassandra-fr JHI_ENTITY=cassandra
- JHI_APP=ngx-couchbase JHI_PROFILE=prod JHI_ENTITY=couchbase

#----------------------------------------------------------------------
# Install all tools and check configuration
Expand Down
8 changes: 5 additions & 3 deletions test-integration/scripts/00-init-env.sh
Expand Up @@ -6,15 +6,17 @@ init_var() {
result=$1
elif [[ $2 != "" ]]; then
result=$2
elif [[ $3 != "" ]]; then
result=$3
fi
echo $result
}

# uri of repo
JHI_REPO=$(init_var "$BUILD_REPOSITORY_URI" "$TRAVIS_REPO_SLUG")
JHI_REPO=$(init_var "$BUILD_REPOSITORY_URI" "$TRAVIS_REPO_SLUG" "$GITHUB_WORKSPACE" )

# folder where the repo is cloned
JHI_CLONED=$(init_var "$BUILD_REPOSITORY_LOCALPATH" "$TRAVIS_BUILD_DIR")
JHI_CLONED=$(init_var "$BUILD_REPOSITORY_LOCALPATH" "$TRAVIS_BUILD_DIR" "$GITHUB_WORKSPACE")

# folder where the generator-jhipster is cloned
JHI_HOME="$HOME"/generator-jhipster
Expand All @@ -35,6 +37,6 @@ JHI_FOLDER_APP="$HOME"/app
JHI_FOLDER_UAA="$HOME"/uaa

# set correct OpenJDK version
if [[ "$JHI_JDK" == "11" ]]; then
if [[ "$JHI_JDK" == "11" && "$JHI_GITHUB_CI" != "true" ]]; then
JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
fi
2 changes: 1 addition & 1 deletion test-integration/scripts/10-install-jhipster-kotlin.sh
Expand Up @@ -91,6 +91,6 @@ npm ci
npm link
npm link generator-jhipster

if [[ "$JHI_APP" == "" || "$JHI_APP" == "ms-micro-consul" ]]; then
if [[ "$JHI_APP" == "" ]]; then
npm test
fi

0 comments on commit 7643290

Please sign in to comment.