Skip to content

Commit 99463f0

Browse files
committed
Trying github actions
1 parent a0b235a commit 99463f0

7 files changed

Lines changed: 107 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build and deploy snapshot
2+
3+
on:
4+
push:
5+
branches: [ develop ]
6+
pull_request:
7+
branches: [ develop ]
8+
9+
workflow_dispatch:
10+
11+
jobs:
12+
env:
13+
UTPLSQL_VERSION: ${{matrix.utplsql-version}}
14+
DB_IMAGE: ${{matrix.db_image}}
15+
build:
16+
17+
runs-on: ubuntu-latest
18+
startegy:
19+
matrix:
20+
utplsql-version: [develop, v3.0.0, v3.1.6, v3.1.11]
21+
db_image: gvenzl/oracle-xe:11-full
22+
23+
services:
24+
oracle:
25+
image: ${{matrix.db_image}}
26+
env:
27+
ORACLE_PASSWORD: oracle
28+
ports:
29+
- 1521:1521
30+
# options: >-
31+
# --health-cmd healthcheck.sh
32+
# --health-interval 10s
33+
# --health-timeout 5s
34+
# --health-retries 10
35+
36+
steps:
37+
- uses: actions/checkout@v2
38+
with:
39+
fetch-depth: 0
40+
41+
- name: Install utPLSQL ${{matrix.utplsql-version}}
42+
run: echo Installing ${UTPLSQL_VERSION} && sh ${{ github.workspace }}/scripts/1_install_utplsql.sh
43+
44+
- name: Install utPLSQL-cli
45+
run: curl -Lk -o utPLSQL-cli.zip "https://github.com/utPLSQL/utPLSQL-cli/releases/download/v3.1.8/utPLSQL-cli.zip" && unzip utPLSQL-cli.zip && chmod -R u+x utPLSQL-cli
46+
47+
- name: Install demo project
48+
run: sh ${{ github.workspace }}/scripts/2_install_demo_project.sh
49+
50+
- name: Install unit tests
51+
run: sh ${{ github.workspace }}/scripts/3_install_tests.sh
52+
53+
- name: Install run tests
54+
run: sh ${{ github.workspace }}/scripts/4_run_tests.sh
55+

scripts/0_start_db.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker run -d --name ora-utplsql -p 1521:1521 -e ORACLE_PASSWORD=oracle gvenzl/oracle-xe:18.4.0-slim

scripts/1_install_utplsql.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
git clone --depth=1 --branch=${UTPLSQL_VERSION} https://github.com/utPLSQL/utPLSQL.git utPLSQL
2+
3+
docker run --rm -v $(pwd)/utPLSQL:/utPLSQL -w /utPLSQL/source --network host \
4+
--entrypoint sqlplus truemark/sqlplus:19.8 sys/oracle@//127.0.0.1:1521/XE as sysdba @install_headless.sql UT3 UT3 users

scripts/2_install_demo_project.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
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 @source/create_users.sql
3+
4+
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
5+
ut3_demo/ut3_demo@//127.0.0.1:1521/XE @source/award_bonus/employees_test.sql
6+
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
7+
ut3_demo/ut3_demo@//127.0.0.1:1521/XE @source/award_bonus/award_bonus.prc
8+
9+
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
10+
ut3_demo/ut3_demo@//127.0.0.1:1521/XE @source/between_string/betwnstr.fnc
11+
12+
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
13+
ut3_demo/ut3_demo@//127.0.0.1:1521/XE @source/remove_rooms_by_name/rooms.sql
14+
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
15+
ut3_demo/ut3_demo@//127.0.0.1:1521/XE @source/remove_rooms_by_name/remove_rooms_by_name.prc
16+

scripts/3_install_tests.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
2+
ut3_demo/ut3_demo@//127.0.0.1:1521/XE @test/award_bonus/test_award_bonus.pks
3+
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
4+
ut3_demo/ut3_demo@//127.0.0.1:1521/XE @test/award_bonus/test_award_bonus.pkb
5+
6+
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
7+
ut3_demo/ut3_demo@//127.0.0.1:1521/XE @test/between_string/test_betwnstr.pks
8+
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
9+
ut3_demo/ut3_demo@//127.0.0.1:1521/XE @test/between_string/test_betwnstr.pkb
10+
11+
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
12+
ut3_demo/ut3_demo@//127.0.0.1:1521/XE @test/remove_rooms_by_name/test_remove_rooms_by_name.pks
13+
docker run --rm -v $(pwd):/work -w /work/ --network host --entrypoint sqlplus truemark/sqlplus:19.8 \
14+
ut3_demo/ut3_demo@//127.0.0.1:1521/XE @test/remove_rooms_by_name/test_remove_rooms_by_name.pkb

scripts/4_run_tests.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -ev
4+
5+
utPLSQL-cli/bin/utplsql run ut3_demo/ut3_demo@//127.0.0.1:1521/XE \
6+
-source_path=source -test_path=test \
7+
-f=ut_documentation_reporter -c \
8+
-f=ut_coverage_sonar_reporter -o=coverage.xml \
9+
-f=ut_sonar_test_reporter -o=test_results.xml \
10+
--failure-exit-code=0
11+

source/create_users.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
create user ut3_demo identified by ut3_demo quota unlimited on USERS default tablespace USERS;
2+
3+
grant create session, create procedure, create type, create table, create sequence, create view to ut3_demo;
4+
grant select any dictionary to ut3_demo;
5+
6+
exit

0 commit comments

Comments
 (0)