-
Notifications
You must be signed in to change notification settings - Fork 9
129 lines (113 loc) · 3.5 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: tests
on:
push:
pull_request:
types: [opened, reopened, review_requested, synchronize]
workflow_dispatch:
# Run tests 10:00 PM (JST) every day
schedule:
- cron: '0 13 * * *'
env:
COBOL4J_LIB_DIR: /usr/lib/opensourcecobol4j
COBOL4J_LIBCOBJ_JAR_PATH: /usr/lib/opensourcecobol4j/libcobj.jar
OCESQL4J_LIB_DIR: /usr/lib/Open-COBOL-ESQL-4j
OCESQL4J_OCESQL4J_JAR_PATH: /usr/lib/Open-COBOL-ESQL-4j/ocesql4j.jar
CLASSPATH: ":/usr/lib/Open-COBOL-ESQL-4j/ocesql4j.jar"
jobs:
Open-COBOL-ESQL-4j-tests:
strategy:
matrix:
os: ["ubuntu:22.04", "almalinux:9"]
runs-on: ubuntu-latest
container:
image: ${{ matrix.os }}
services:
# Start PostgreSQL 9.6 server
postgres9_6:
image: postgres:9.6
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: password
POSTGRES_USER: main_user
POSTGRES_DB: testdb
POSTGRES_HOST_AUTH_METHOD: 'trust'
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# Start PostgreSQL 15 server
postgres15:
image: postgres:15
ports:
- 5433:5432
env:
POSTGRES_PASSWORD: password
POSTGRES_USER: main_user
POSTGRES_DB: testdb
POSTGRES_HOST_AUTH_METHOD: 'trust'
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
# Install dependencies (Ubuntu 22.04)
- name: Install dependencies on Ubuntu 22.04
if: matrix.os == 'ubuntu:22.04'
run: |
apt update -y
apt install -y build-essential bison flex gettext texinfo automake autoconf curl
# Install dependencies (Almalinux 9)
- name: Install dependencies on AlmaLinux 9
if: matrix.os == 'almalinux:9'
run: |
dnf -y update
dnf install -y gcc gcc-c++ make bison flex automake autoconf diffutils gettext
# Setup JDK
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
# Setup sbt
- name: Setup sbt
uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
# Checkout
- name: Checkout Open-COBOL-ESQL-4j
uses: actions/checkout@v3
# Checkout opensource COBOL 4J
- name: Checkout opensourcecobol 4J
uses: actions/checkout@v3
with:
repository: opensourcecobol/opensourcecobol4j
path: opensourcecobol4j
# Install opensource COBOL 4J
- name: Install opensource COBOL 4J
run: |
cd opensourcecobol4j
./configure --prefix=/usr/
make
make install
# Build and Install Open COBOL ESQL 4J
- name: Install Open COBOL ESQL 4J
run: |
cp $COBOL4J_LIBCOBJ_JAR_PATH dblibj/lib
sh configure --prefix=/usr/
make
make install
# Run Autotest for PostgreSQL 9.6
- name: Run tests for PostgreSQL 9.6
run: |
cd tests
cp ../.github/workflows/db-settings/embed_db_info_postgresql_9.6.sh embed_db_info.sh
make test
# Run Autotest for PostgreSQL 15
- name: Run tests for PostgreSQL 15
run: |
cd tests
cp ../.github/workflows/db-settings/embed_db_info_postgresql_15.sh embed_db_info.sh
make test