Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/scripts/1_install_utplsql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
set -ev
cd $(dirname $(readlink -f $0))

# Download the specified version of utPLSQL.
if [ "$UTPLSQL_VERSION" == "develop" ]
then
git clone -b develop --single-branch https://github.com/utPLSQL/utPLSQL.git
else
curl -L -O "https://github.com/utPLSQL/utPLSQL/releases/download/$UTPLSQL_VERSION/$UTPLSQL_FILE.tar.gz"
tar -xzf ${UTPLSQL_FILE}.tar.gz && rm ${UTPLSQL_FILE}.tar.gz
fi

chmod -R go+w ./${UTPLSQL_FILE}/{source,examples}
# Create a temporary install script.
cat > install.sh.tmp <<EOF
cd /${UTPLSQL_FILE}/source
sqlplus -S -L sys/oracle@${DB_URL} AS SYSDBA @install_headless.sql ut3 ut3 users
EOF

# Copy utPLSQL files to the container and install it.
docker cp ./${UTPLSQL_FILE} oracle:/${UTPLSQL_FILE}
docker cp ./install.sh.tmp oracle:/install.sh
# Remove temporary files.
# rm $UTPLSQL_FILE.tar.gz
rm -rf $UTPLSQL_FILE
rm install.sh.tmp

# Execute the utPLSQL installation inside the container.
docker exec oracle bash /install.sh
9 changes: 5 additions & 4 deletions scripts/2_install_demo_project.sh → .github/scripts/2_install_demo_project.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
sys/oracle@//127.0.0.1:1521/XE as sysdba @scripts/sql/create_users.sql
sys/oracle@${DB_URL} as sysdba @.github/scripts/sql/create_users.sql

docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
app/pass@//127.0.0.1:1521/XE @scripts/sql/create_app_objects.sql
app/pass@${DB_URL} @.github/scripts/sql/create_app_objects.sql

docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
code_owner/pass@//127.0.0.1:1521/XE @scripts/sql/create_source_owner_objects.sql
code_owner/pass@${DB_URL} @.github/scripts/sql/create_source_owner_objects.sql

docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
tests_owner/pass@//127.0.0.1:1521/XE @scripts/sql/create_tests_owner_objects.sql
tests_owner/pass@${DB_URL} @.github/scripts/sql/create_tests_owner_objects.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ grant create any procedure to &UTPLSQL_USER;
grant execute on dbms_lob to &UTPLSQL_USER;
grant execute on dbms_sql to &UTPLSQL_USER;
grant execute on dbms_xmlgen to &UTPLSQL_USER;
grant execute on dbms_lock to &UTPLSQL_USER;
grant execute on dbms_lock to &UTPLSQL_USER;

create user &APP_USER identified by &DB_PASS quota unlimited on USERS default tablespace USERS;
grant create session, create procedure, create type, create table, create sequence, create view to &APP_USER;
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/api-snapshot-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Test with utplsql-java-api snapshot

on:
workflow_dispatch:
inputs:
api_version:
description: 'utplsql-java-api snapshot version (e.g. 3.2.4-SNAPSHOT)'
required: true

repository_dispatch:
types: [utPLSQL-java-api-build]

defaults:
run:
shell: bash

jobs:
build:
name: Test with utplsql-java-api ${{ github.event.client_payload.api_version || inputs.api_version }}
runs-on: ubuntu-latest
env:
UTPLSQL_VERSION: develop
UTPLSQL_FILE: utPLSQL
DB_URL: "//localhost:1521/FREEPDB1"
DB_USER: APP
DB_PASS: pass

services:
oracle:
image: gvenzl/oracle-free:23-slim-faststart
env:
ORACLE_PASSWORD: oracle
DB_URL: "//localhost:1521/FREEPDB1"
ports:
- 1521:1521
options: >-
--health-cmd healthcheck.sh
--health-interval 10s
--health-timeout 5s
--health-retries 10
--name oracle

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'

- name: Install utplsql
run: .github/scripts/1_install_utplsql.sh

- name: Install demo project
run: .github/scripts/2_install_demo_project.sh

- name: Build and Test
run: |
API_VERSION="${{ github.event.client_payload.api_version || inputs.api_version }}"
mvn verify appassembler:assemble -Dutplsql-java-api.version="$API_VERSION"
46 changes: 17 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@ name: Build and deploy snapshot

on:
push:
branches-ignore: [ main ]
branches: [ develop ]
pull_request:
branches: [ develop ]

workflow_dispatch:

repository_dispatch:
type: [utPLSQL-build,utPLSQL-java-api-build]

jobs:
build:

runs-on: ubuntu-latest
env:
UTPLSQL_VERSION: develop
UTPLSQL_FILE: utPLSQL
DB_URL: "//localhost:1521/FREEPDB1"
DB_USER: APP
DB_PASS: pass

services:
oracle:
image: gvenzl/oracle-xe:21-slim
image: gvenzl/oracle-free:23-slim-faststart
env:
ORACLE_PASSWORD: oracle
ports:
Expand All @@ -28,39 +31,40 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 10
--name oracle

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install utPLSQL
run: sh ${{ github.workspace }}/scripts/1_install_utplsql.sh
run: .github/scripts/1_install_utplsql.sh

- name: Install demo project
run: sh ${{ github.workspace }}/scripts/2_install_demo_project.sh
run: .github/scripts/2_install_demo_project.sh

- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'adopt'
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Cache local Maven repository
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Maven unit and integration tests with sonar
run: mvn clean verify sonar:sonar -Pcoverage -Dsonar.projectKey=org.utplsql:utplsql-maven-plugin
run: mvn clean verify sonar:sonar -Pcoverage -Dsonar.projectKey=utPLSQL_utPLSQL-maven-plugin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand All @@ -73,23 +77,7 @@ jobs:
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

- name: Publish unit test results
uses: EnricoMi/publish-unit-test-result-action@v1.24
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: target/**/TEST**.xml

slack-workflow-status:
if: always()
name: Post Workflow Status To Slack
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: Slack Workflow Notification
uses: Gamesight/slack-workflow-status@master
with:
# Required Input
repo_token: ${{secrets.GITHUB_TOKEN}}
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}}
# Optional Input
name: 'Github Actions[bot]'
icon_url: 'https://octodex.github.com/images/mona-the-rivetertocat.png'
33 changes: 9 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

services:
oracle:
image: gvenzl/oracle-xe:21-slim
image: gvenzl/oracle-free:23-slim-faststart
env:
ORACLE_PASSWORD: oracle
ports:
Expand All @@ -23,27 +23,27 @@ jobs:
--health-retries 10

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install utPLSQL
run: sh ${{ github.workspace }}/scripts/1_install_utplsql.sh
run: .github/scripts/1_install_utplsql.sh

- name: Install demo project
run: sh ${{ github.workspace }}/scripts/2_install_demo_project.sh
run: .github/scripts/2_install_demo_project.sh

- name: Set up JDK 11
uses: actions/setup-java@v2
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '11'
distribution: 'adopt'
java-version: '17'
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Cache local Maven repository
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand All @@ -57,18 +57,3 @@ jobs:
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

slack-workflow-status:
if: always()
name: Post Workflow Status To Slack
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: Slack Workflow Notification
uses: Gamesight/slack-workflow-status@master
with:
# Required Input
repo_token: ${{secrets.GITHUB_TOKEN}}
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}}
# Optional Input
name: 'Github Actions[bot]'
icon_url: 'https://octodex.github.com/images/mona-the-rivetertocat.png'
Loading
Loading