generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 1
113 lines (113 loc) · 4.34 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: ci
on:
push:
branches: [ main ]
pull_request:
branches:
- '**'
paths-ignore:
- '**/**.md'
jobs:
run-parse-server-ci:
name: CI of Parse Server
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix:
version: [7.3.0-alpha.7]
steps:
- name: Checkout parse-server ${{ matrix.version }}
uses: actions/checkout@v2
with:
repository: parse-community/parse-server
ref: ${{ matrix.version }}
path: parse-server
- name: Checkout templateCodeAndSpecs
uses: actions/checkout@v2
with:
repository: oracle-samples/oracleadapter-parse
ref: removeTestExclusions
path: oraCodeAndSpecs
- name: Create Oracle Storage Adapter Dir
run: mkdir parse-server/src/Adapters/Storage/Oracle;
ls -la parse-server/src/Adapters/Storage/Oracle;
cp $PWD/oraCodeAndSpecs/*.js $PWD/parse-server/src/Adapters/Storage/Oracle;
ls -la parse-server/src/Adapters/Storage;
ls -la parse-server/src/Adapters/Storage/Oracle;
- name: Install Sqlcl
run: wget https://download.oracle.com/otn_software/java/sqldeveloper/sqlcl-23.3.0.270.1251.zip;
unzip sqlcl-23.3.0.270.1251.zip;
./sqlcl/bin/sql -V;
- name: Install Instant Client
run: uname -m;
wget https://download.oracle.com/otn_software/linux/instantclient/2340000/instantclient-basic-linux.x64-23.4.0.24.05.zip;
unzip instantclient-basic-linux.x64-23.4.0.24.05.zip;
ls -la;
ls -la $PWD/instantclient_23_4;
- name: Install libaio1
run: sudo apt-get install libaio1;
- name: Move Oracle Tests
run: ls;
echo $PWD;
ls -la $PWD;
mv $PWD/oraCodeAndSpecs/spec/testExclusionList.json parse-server/spec;
mv $PWD/oraCodeAndSpecs/spec/jasmine.json parse-server/spec/support;
cat parse-server/spec/support/jasmine.json;
- name: Run Free23c
run: docker run --name free23c -d -p 1521:1521 -e ORACLE_PWD=Welcome12345 container-registry.oracle.com/database/free:latest;
docker ps -a;
docker images;
- name: Wait for container
run: sleep 120;
docker ps -a;
./sqlcl/bin/sql -V;
- name: Enable SODA in image
run: echo "alter session set container=FREEPDB1;grant db_developer_role to pdbadmin;grant soda_app to pdbadmin;GRANT UNLIMITED TABLESPACE TO pdbadmin;quit;" > soda;
cat soda;
./sqlcl/bin/sql sys/Welcome12345@localhost:1521/free as sysdba @./soda
- name: Run Tests
run: echo $PWD;
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash;
export NVM_DIR="$HOME/.nvm";
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh";
nvm install v20.12.0;
nvm list;
node --version;
echo "Before setting LIB PATH";
export LD_LIBRARY_PATH=${PWD}/instantclient_23_4;
echo "This is LD LIBRARY PATH";
echo $LD_LIBRARY_PATH;
echo "Run it";
cd parse-server;
cat package.json;
npm install --save @parse/fs-files-adapter;
npm install [email protected];
npm ci;
export UV_THREADPOOL_SIZE=128;
export PARSE_SERVER_TEST_DB=oracle;
export ORACLE_CLIENT_LOCATION=${LD_LIBRARY_PATH};
export PARSE_SERVER_DATABASE_ADAPTER='{"module":"../Adapters/Storage/Oracle/OracleStorageAdapter","options":{"databaseURI":"oracledb://pdbadmin:Welcome12345@localhost:1521/freepdb1","collectionPrefix":"test_"}}';
echo $PARSE_SERVER_DATABASE_ADAPTER;
npm run testonly;
- name: Dump Container logs
if: always()
run: mkdir oralogs;
docker cp free23c:/opt/oracle/diag/rdbms/free/FREE/trace oralogs;
docker cp free23c:/opt/oracle/diag/rdbms/free/FREE oradumps;
ls -la oralogs;
ls -la oradumps;
- name: Archive Test Results
if: always()
uses: actions/upload-artifact@v1
with:
name: containerlogs
path: oralogs/trace
- name: Archive Test Results
if: always()
uses: actions/upload-artifact@v1
with:
name: containerdumps
path: oradumps
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true