Skip to content

Commit b415c63

Browse files
author
Jacek Gębal
committed
Update build process.
1 parent 6497f28 commit b415c63

38 files changed

Lines changed: 172 additions & 104 deletions

File tree

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/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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,20 @@ on:
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
1815
env:
16+
UTPLSQL_VERSION: develop
17+
UTPLSQL_FILE: utPLSQL
1918
DB_URL: "//localhost:1521/FREEPDB1"
20-
DB_USER: UT3
21-
DB_PASS: UT3
19+
DB_USER: APP
20+
DB_PASS: pass
2221

2322
services:
2423
oracle:
25-
image: gvenzl/oracle-xe:21-slim
24+
image: gvenzl/oracle-free:23-slim-faststart
2625
env:
2726
ORACLE_PASSWORD: oracle
2827
ports:
@@ -32,6 +31,7 @@ jobs:
3231
--health-interval 10s
3332
--health-timeout 5s
3433
--health-retries 10
34+
--name oracle
3535
3636
steps:
3737
- uses: actions/checkout@v4
@@ -48,7 +48,7 @@ jobs:
4848
uses: actions/setup-java@v5
4949
with:
5050
java-version: '17'
51-
distribution: 'adopt'
51+
distribution: 'temurin'
5252
server-id: ossrh
5353
server-username: MAVEN_USERNAME
5454
server-password: MAVEN_PASSWORD

.github/workflows/release.yml

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
services:
1313
oracle:
14-
image: gvenzl/oracle-xe:21-slim
14+
image: gvenzl/oracle-free:23-slim-faststart
1515
env:
1616
ORACLE_PASSWORD: oracle
1717
ports:
@@ -23,27 +23,27 @@ jobs:
2323
--health-retries 10
2424
2525
steps:
26-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v4
2727

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

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

34-
- name: Set up JDK 11
35-
uses: actions/setup-java@v2
34+
- name: Set up JDK 17
35+
uses: actions/setup-java@v5
3636
with:
37-
java-version: '11'
38-
distribution: 'adopt'
37+
java-version: '17'
38+
distribution: 'temurin'
3939
server-id: ossrh
4040
server-username: MAVEN_USERNAME
4141
server-password: MAVEN_PASSWORD
4242
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
4343
gpg-passphrase: MAVEN_GPG_PASSPHRASE
4444

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

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'

scripts/1_install_utplsql.sh

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
1-
UTPLSQL_DOWNLOAD_URL=$(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip\"" | sed 's/"//g')
1+
#!/bin/bash
2+
set -ev
3+
cd $(dirname $(readlink -f $0))
24

3-
curl -Lk "${UTPLSQL_DOWNLOAD_URL}" -o utPLSQL.zip
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
413

5-
unzip -q utPLSQL.zip
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
620

7-
docker run --rm -v $(pwd)/utPLSQL:/utPLSQL -w /utPLSQL/source --network host \
8-
--entrypoint sqlplus truemark/sqlplus:19.8 sys/oracle@${DB_URL} as sysdba @install_headless.sql UT3 UT3 users
21+
# Copy utPLSQL files to the container and install it.
22+
docker cp ./${UTPLSQL_FILE} oracle:/${UTPLSQL_FILE}
23+
# docker cp ./$UTPLSQL_FILE $ORACLE_VERSION:/$UTPLSQL_FILE
24+
docker cp ./install.sh.tmp oracle:/install.sh
25+
docker cp ./create_api_user.sh oracle:/create_api_user.sh
26+
# Remove temporary files.
27+
# rm $UTPLSQL_FILE.tar.gz
28+
rm -rf $UTPLSQL_FILE
29+
rm install.sh.tmp
30+
31+
# Execute the utPLSQL installation inside the container.
32+
docker exec oracle bash /install.sh
33+
docker exec oracle bash /create_api_user.sh

scripts/sql/create_users.sql

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;

src/test/java/org/utplsql/maven/plugin/UtPlsqlMojoTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ public void dbms_output() throws Exception {
309309
@Test
310310
public void db_config_using_system_properties() throws Exception {
311311
System.setProperty("dbUrl", "jdbc:oracle:thin:@//localhost:1521/FREEPDB1");
312-
System.setProperty("dbUser", "APP");
313-
System.setProperty("dbPass", "pass");
312+
System.setProperty("dbUser", "UT3");
313+
System.setProperty("dbPass", "ut3");
314314

315315
UtPlsqlMojo utPlsqlMojo = createUtPlsqlMojo("db_config_using_system_properties");
316316
assertNotNull(utPlsqlMojo);

src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT/exclude_object/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
<properties>
1212
<dbUrl>jdbc:oracle:thin:@//localhost:1521/FREEPDB1</dbUrl>
13-
<dbUser>APP</dbUser>
14-
<dbPass>pass</dbPass>
13+
<dbUser>UT3</dbUser>
14+
<dbPass>ut3</dbPass>
1515
</properties>
1616

1717
<build>

src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT/exclude_object_expr/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
<properties>
1212
<dbUrl>jdbc:oracle:thin:@//localhost:1521/FREEPDB1</dbUrl>
13-
<dbUser>APP</dbUser>
14-
<dbPass>pass</dbPass>
13+
<dbUser>UT3</dbUser>
14+
<dbPass>ut3</dbPass>
1515
</properties>
1616

1717
<build>

src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT/include_object/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
<properties>
1212
<dbUrl>jdbc:oracle:thin:@//localhost:1521/FREEPDB1</dbUrl>
13-
<dbUser>APP</dbUser>
14-
<dbPass>pass</dbPass>
13+
<dbUser>UT3</dbUser>
14+
<dbPass>ut3</dbPass>
1515
</properties>
1616

1717
<build>

src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT/include_object_expr/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
<properties>
1212
<dbUrl>jdbc:oracle:thin:@//localhost:1521/FREEPDB1</dbUrl>
13-
<dbUser>APP</dbUser>
14-
<dbPass>pass</dbPass>
13+
<dbUser>UT3</dbUser>
14+
<dbPass>ut3</dbPass>
1515
</properties>
1616

1717
<build>
@@ -42,7 +42,7 @@
4242
<consoleOutput>true</consoleOutput>
4343
</reporter>
4444
</reporters>
45-
<includeObjectExpr>app.*</includeObjectExpr>
45+
<includeObjectExpr>APP.*</includeObjectExpr>
4646
</configuration>
4747
</execution>
4848
</executions>

0 commit comments

Comments
 (0)