Skip to content

Commit e63c898

Browse files
authored
Merge pull request #80 from utPLSQL/feature/update_to_java_17
Update plugin to Java 17 and latest java-api
2 parents 66211d6 + e4f2831 commit e63c898

48 files changed

Lines changed: 294 additions & 246 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
set -ev
3+
cd $(dirname $(readlink -f $0))
4+
5+
# Download the specified version of utPLSQL.
6+
if [ "$UTPLSQL_VERSION" == "develop" ]
7+
then
8+
git clone -b develop --single-branch https://github.com/utPLSQL/utPLSQL.git
9+
else
10+
curl -L -O "https://github.com/utPLSQL/utPLSQL/releases/download/$UTPLSQL_VERSION/$UTPLSQL_FILE.tar.gz"
11+
tar -xzf ${UTPLSQL_FILE}.tar.gz && rm ${UTPLSQL_FILE}.tar.gz
12+
fi
13+
14+
chmod -R go+w ./${UTPLSQL_FILE}/{source,examples}
15+
# Create a temporary install script.
16+
cat > install.sh.tmp <<EOF
17+
cd /${UTPLSQL_FILE}/source
18+
sqlplus -S -L sys/oracle@${DB_URL} AS SYSDBA @install_headless.sql ut3 ut3 users
19+
EOF
20+
21+
# Copy utPLSQL files to the container and install it.
22+
docker cp ./${UTPLSQL_FILE} oracle:/${UTPLSQL_FILE}
23+
docker cp ./install.sh.tmp oracle:/install.sh
24+
# Remove temporary files.
25+
# rm $UTPLSQL_FILE.tar.gz
26+
rm -rf $UTPLSQL_FILE
27+
rm install.sh.tmp
28+
29+
# Execute the utPLSQL installation inside the container.
30+
docker exec oracle bash /install.sh
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
#!/bin/bash
12
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
2-
sys/oracle@//127.0.0.1:1521/XE as sysdba @scripts/sql/create_users.sql
3+
sys/oracle@${DB_URL} as sysdba @.github/scripts/sql/create_users.sql
34

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

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

1011
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
11-
tests_owner/pass@//127.0.0.1:1521/XE @scripts/sql/create_tests_owner_objects.sql
12+
tests_owner/pass@${DB_URL} @.github/scripts/sql/create_tests_owner_objects.sql
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ grant create any procedure to &UTPLSQL_USER;
1414
grant execute on dbms_lob to &UTPLSQL_USER;
1515
grant execute on dbms_sql to &UTPLSQL_USER;
1616
grant execute on dbms_xmlgen to &UTPLSQL_USER;
17-
grant execute on dbms_lock to &UTPLSQL_USER;
17+
grant execute on dbms_lock to &UTPLSQL_USER;
1818

1919
create user &APP_USER identified by &DB_PASS quota unlimited on USERS default tablespace USERS;
2020
grant create session, create procedure, create type, create table, create sequence, create view to &APP_USER;
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Test with utplsql-java-api snapshot
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
api_version:
7+
description: 'utplsql-java-api snapshot version (e.g. 3.2.4-SNAPSHOT)'
8+
required: true
9+
10+
repository_dispatch:
11+
types: [utPLSQL-java-api-build]
12+
13+
defaults:
14+
run:
15+
shell: bash
16+
17+
jobs:
18+
build:
19+
name: Test with utplsql-java-api ${{ github.event.client_payload.api_version || inputs.api_version }}
20+
runs-on: ubuntu-latest
21+
env:
22+
UTPLSQL_VERSION: develop
23+
UTPLSQL_FILE: utPLSQL
24+
DB_URL: "//localhost:1521/FREEPDB1"
25+
DB_USER: APP
26+
DB_PASS: pass
27+
28+
services:
29+
oracle:
30+
image: gvenzl/oracle-free:23-slim-faststart
31+
env:
32+
ORACLE_PASSWORD: oracle
33+
DB_URL: "//localhost:1521/FREEPDB1"
34+
ports:
35+
- 1521:1521
36+
options: >-
37+
--health-cmd healthcheck.sh
38+
--health-interval 10s
39+
--health-timeout 5s
40+
--health-retries 10
41+
--name oracle
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
with:
46+
fetch-depth: 0
47+
48+
- name: Set up JDK
49+
uses: actions/setup-java@v5
50+
with:
51+
distribution: 'temurin'
52+
java-version: '21'
53+
54+
- name: Install utplsql
55+
run: .github/scripts/1_install_utplsql.sh
56+
57+
- name: Install demo project
58+
run: .github/scripts/2_install_demo_project.sh
59+
60+
- name: Build and Test
61+
run: |
62+
API_VERSION="${{ github.event.client_payload.api_version || inputs.api_version }}"
63+
mvn verify appassembler:assemble -Dutplsql-java-api.version="$API_VERSION"

.github/workflows/build.yml

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,26 @@ name: Build and deploy snapshot
22

33
on:
44
push:
5-
branches-ignore: [ main ]
5+
branches: [ develop ]
66
pull_request:
77
branches: [ develop ]
88

99
workflow_dispatch:
1010

11-
repository_dispatch:
12-
type: [utPLSQL-build,utPLSQL-java-api-build]
13-
1411
jobs:
1512
build:
1613

1714
runs-on: ubuntu-latest
15+
env:
16+
UTPLSQL_VERSION: develop
17+
UTPLSQL_FILE: utPLSQL
18+
DB_URL: "//localhost:1521/FREEPDB1"
19+
DB_USER: APP
20+
DB_PASS: pass
1821

1922
services:
2023
oracle:
21-
image: gvenzl/oracle-xe:21-slim
24+
image: gvenzl/oracle-free:23-slim-faststart
2225
env:
2326
ORACLE_PASSWORD: oracle
2427
ports:
@@ -28,68 +31,52 @@ jobs:
2831
--health-interval 10s
2932
--health-timeout 5s
3033
--health-retries 10
34+
--name oracle
3135
3236
steps:
33-
- uses: actions/checkout@v2
34-
with:
35-
fetch-depth: 0
37+
- uses: actions/checkout@v4
3638

3739
- name: Install utPLSQL
38-
run: sh ${{ github.workspace }}/scripts/1_install_utplsql.sh
40+
run: .github/scripts/1_install_utplsql.sh
3941

4042
- name: Install demo project
41-
run: sh ${{ github.workspace }}/scripts/2_install_demo_project.sh
43+
run: .github/scripts/2_install_demo_project.sh
4244

4345
- name: Set up JDK 17
44-
uses: actions/setup-java@v2
46+
uses: actions/setup-java@v5
4547
with:
4648
java-version: '17'
47-
distribution: 'adopt'
48-
server-id: ossrh
49+
distribution: 'temurin'
50+
server-id: central
4951
server-username: MAVEN_USERNAME
5052
server-password: MAVEN_PASSWORD
5153
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
5254
gpg-passphrase: MAVEN_GPG_PASSPHRASE
5355

5456
- name: Cache local Maven repository
55-
uses: actions/cache@v2
57+
uses: actions/cache@v4
5658
with:
5759
path: ~/.m2/repository
5860
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
5961
restore-keys: |
6062
${{ runner.os }}-maven-
6163
6264
- name: Maven unit and integration tests with sonar
63-
run: mvn clean verify sonar:sonar -Pcoverage -Dsonar.projectKey=org.utplsql:utplsql-maven-plugin
65+
run: mvn clean verify sonar:sonar -Pcoverage -Dsonar.projectKey=utPLSQL_utPLSQL-maven-plugin
6466
env:
6567
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6668
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6769

6870
- name: Maven deploy snapshot
71+
if: github.event_name != 'pull_request'
6972
run: mvn deploy -DskipTests
7073
env:
7174
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
7275
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
7376
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
7477

7578
- name: Publish unit test results
76-
uses: EnricoMi/publish-unit-test-result-action@v1.24
79+
uses: EnricoMi/publish-unit-test-result-action@v2
7780
if: always()
7881
with:
7982
files: target/**/TEST**.xml
80-
81-
slack-workflow-status:
82-
if: always()
83-
name: Post Workflow Status To Slack
84-
needs: [ build ]
85-
runs-on: ubuntu-latest
86-
steps:
87-
- name: Slack Workflow Notification
88-
uses: Gamesight/slack-workflow-status@master
89-
with:
90-
# Required Input
91-
repo_token: ${{secrets.GITHUB_TOKEN}}
92-
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}}
93-
# Optional Input
94-
name: 'Github Actions[bot]'
95-
icon_url: 'https://octodex.github.com/images/mona-the-rivetertocat.png'

.github/workflows/release.yml

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@ jobs:
88
build:
99

1010
runs-on: ubuntu-latest
11+
env:
12+
UTPLSQL_VERSION: develop
13+
UTPLSQL_FILE: utPLSQL
14+
DB_URL: "//localhost:1521/FREEPDB1"
15+
DB_USER: APP
16+
DB_PASS: pass
1117

1218
services:
1319
oracle:
14-
image: gvenzl/oracle-xe:21-slim
20+
image: gvenzl/oracle-free:23-slim-faststart
1521
env:
1622
ORACLE_PASSWORD: oracle
1723
ports:
@@ -21,29 +27,30 @@ jobs:
2127
--health-interval 10s
2228
--health-timeout 5s
2329
--health-retries 10
30+
--name oracle
2431
2532
steps:
26-
- uses: actions/checkout@v2
33+
- uses: actions/checkout@v4
2734

2835
- name: Install utPLSQL
29-
run: sh ${{ github.workspace }}/scripts/1_install_utplsql.sh
36+
run: .github/scripts/1_install_utplsql.sh
3037

3138
- name: Install demo project
32-
run: sh ${{ github.workspace }}/scripts/2_install_demo_project.sh
39+
run: .github/scripts/2_install_demo_project.sh
3340

34-
- name: Set up JDK 11
35-
uses: actions/setup-java@v2
41+
- name: Set up JDK 17
42+
uses: actions/setup-java@v5
3643
with:
37-
java-version: '11'
38-
distribution: 'adopt'
39-
server-id: ossrh
44+
java-version: '17'
45+
distribution: 'temurin'
46+
server-id: central
4047
server-username: MAVEN_USERNAME
4148
server-password: MAVEN_PASSWORD
4249
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
4350
gpg-passphrase: MAVEN_GPG_PASSPHRASE
4451

4552
- name: Cache local Maven repository
46-
uses: actions/cache@v2
53+
uses: actions/cache@v4
4754
with:
4855
path: ~/.m2/repository
4956
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
@@ -57,18 +64,3 @@ jobs:
5764
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
5865
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
5966

60-
slack-workflow-status:
61-
if: always()
62-
name: Post Workflow Status To Slack
63-
needs: [ build ]
64-
runs-on: ubuntu-latest
65-
steps:
66-
- name: Slack Workflow Notification
67-
uses: Gamesight/slack-workflow-status@master
68-
with:
69-
# Required Input
70-
repo_token: ${{secrets.GITHUB_TOKEN}}
71-
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}}
72-
# Optional Input
73-
name: 'Github Actions[bot]'
74-
icon_url: 'https://octodex.github.com/images/mona-the-rivetertocat.png'

0 commit comments

Comments
 (0)