From 7733c167fd0fc092f20d0aa6b3030ba122fb9a73 Mon Sep 17 00:00:00 2001 From: Jacek Gebal Date: Sun, 16 Jan 2022 18:02:43 +0200 Subject: [PATCH 1/6] Adding Github Action to build and test the project --- .github/workflows/build.yml | 87 +++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..5b6c545 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,87 @@ +name: Build and test +on: + push: + branches: [ develop ] + tags: + - v* + pull_request: + branches: [ develop ] + workflow_dispatch: + repository_dispatch: + types: [utPLSQL-build] + +defaults: + run: + shell: bash + +jobs: + build: + name: Test on JDK ${{ matrix.jdk }} with utPLSQL ${{ matrix.utplsql_version }} + runs-on: ubuntu-latest + env: + ORACLE_VERSION: "gvenzl/oracle-xe:18.4.0-slim" + UTPLSQL_VERSION: ${{matrix.utplsql_version}} + UTPLSQL_FILE: ${{matrix.utplsql_file}} + ORACLE_PASSWORD: oracle + DB_URL: "127.0.0.1:1521:XE" + DB_USER: app + DB_PASS: app + + strategy: + fail-fast: false + matrix: + utplsql_version: ["v3.0.1","v3.0.2","v3.0.3","v3.0.4","v3.1.1","v3.1.2","v3.1.3","v3.1.6","v3.1.7","v3.1.8","v3.1.9","v3.1.10","v3.1.11","develop"] + utplsql_file: ["utPLSQL"] + jdk: ['8'] + include: + - utplsql_version: "v3.0.0" + jdk: '8' + utplsql_file: "utPLSQLv3.0.0" + services: + oracle: + image: gvenzl/oracle-xe:18.4.0-slim + env: + ORACLE_PASSWORD: oracle + ports: + - 1521:1521 + options: >- + --health-cmd healthcheck.sh + --health-interval 10s + --health-timeout 5s + --health-retries 10 + --name oracle + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: ${{matrix.jdk}} + cache: 'maven' + + - name: Install utplsql + run: .travis/install_utplsql.sh + + - name: Install demo project + run: .travis/install_demo_project.sh + + - name: Build + run: mvn package -DskipTests + - name: Test + run: mvn package verify jar:jar appassembler:assemble + + slack-workflow-status: + if: always() + name: Post Workflow Status To Slack + needs: [ build, deploy ] + runs-on: ubuntu-latest + steps: + - name: Slack Workflow Notification + uses: Gamesight/slack-workflow-status@master + with: + repo_token: ${{secrets.GITHUB_TOKEN}} + slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}} + name: 'Github Actions[bot]' + icon_url: 'https://octodex.github.com/images/mona-the-rivetertocat.png' From e27c07e7c3d6ff45d1dd3ef5dfa800cf4d5d51c1 Mon Sep 17 00:00:00 2001 From: Jacek Gebal Date: Sun, 16 Jan 2022 18:17:21 +0200 Subject: [PATCH 2/6] Adding badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d3d4e17..8e397c3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![latest-release](https://img.shields.io/github/release/utPLSQL/utPLSQL-cli.svg)](https://github.com/utPLSQL/utPLSQL-cli/releases) [![license](https://img.shields.io/github/license/utPLSQL/utPLSQL-cli.svg)](https://www.apache.org/licenses/LICENSE-2.0) -[![build](https://img.shields.io/travis/utPLSQL/utPLSQL-cli/develop.svg?label=develop%20branch)](https://travis-ci.org/utPLSQL/utPLSQL-cli) +[![Build status](https://github.com/utPLSQL/utPLSQL-cli/actions/workflows/build.yml/badge.svg)](https://github.com/utPLSQL/utPLSQL-cli/actions/workflows/build.yml) ---------- # utPLSQL-cli From eca50c8203f66a56dfdaac6116d33b2922bb785c Mon Sep 17 00:00:00 2001 From: Jacek Gebal Date: Sun, 16 Jan 2022 18:17:33 +0200 Subject: [PATCH 3/6] testing build on branch --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b6c545..d81721a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: Build and test on: push: - branches: [ develop ] + branches: [ develop, feature/github_actions ] tags: - v* pull_request: From 3e5bdfef4060a902d89b648eb271cc97ecc8a9b5 Mon Sep 17 00:00:00 2001 From: Jacek Gebal Date: Sun, 16 Jan 2022 18:18:27 +0200 Subject: [PATCH 4/6] testing build on branch --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d81721a..6f3c83b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,7 +75,7 @@ jobs: slack-workflow-status: if: always() name: Post Workflow Status To Slack - needs: [ build, deploy ] + needs: [ build ] runs-on: ubuntu-latest steps: - name: Slack Workflow Notification From 4cc8b839aa566d1de30af93634d6a20b4d8ffa58 Mon Sep 17 00:00:00 2001 From: Jacek Gebal Date: Sun, 16 Jan 2022 18:38:03 +0200 Subject: [PATCH 5/6] Fixing sh file privileges --- .travis/create_api_user.sh | 0 .travis/create_release.sh | 0 .travis/install_demo_project.sh | 0 .travis/install_utplsql.sh | 0 .travis/start_db.sh | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .travis/create_api_user.sh mode change 100644 => 100755 .travis/create_release.sh mode change 100644 => 100755 .travis/install_demo_project.sh mode change 100644 => 100755 .travis/install_utplsql.sh mode change 100644 => 100755 .travis/start_db.sh diff --git a/.travis/create_api_user.sh b/.travis/create_api_user.sh old mode 100644 new mode 100755 diff --git a/.travis/create_release.sh b/.travis/create_release.sh old mode 100644 new mode 100755 diff --git a/.travis/install_demo_project.sh b/.travis/install_demo_project.sh old mode 100644 new mode 100755 diff --git a/.travis/install_utplsql.sh b/.travis/install_utplsql.sh old mode 100644 new mode 100755 diff --git a/.travis/start_db.sh b/.travis/start_db.sh old mode 100644 new mode 100755 From 51158d04fa3a682494cd9973b6a9d14cac8d71e2 Mon Sep 17 00:00:00 2001 From: Jacek Gebal Date: Sun, 16 Jan 2022 18:41:49 +0200 Subject: [PATCH 6/6] Fixing scripts --- .travis/install_demo_project.sh | 10 +++++----- .travis/install_utplsql.sh | 21 ++++++++++----------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.travis/install_demo_project.sh b/.travis/install_demo_project.sh index adb9566..20bf1a4 100755 --- a/.travis/install_demo_project.sh +++ b/.travis/install_demo_project.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -ev +set -evx cd $(dirname $(readlink -f $0)) PROJECT_FILE="utPLSQL-demo-project" @@ -13,7 +13,7 @@ grant select any dictionary to ${DB_USER}; exit SQL -cd ${PROJECT_FILE} +cd /${PROJECT_FILE} sqlplus -S -L ${DB_USER}/${DB_PASS}@//127.0.0.1:1521/xe < install.sh.tmp <