Add --quiet
option
#55
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Open-COBOL-ESQL tests | |
on: | |
push: | |
pull_request: | |
types: [opened, reopened, review_requested, synchronize] | |
permissions: | |
contents: read | |
jobs: | |
check-workflows: | |
uses: ./.github/workflows/check-workflows.yml | |
Open-COBOL-ESQL-tests: | |
needs: check-workflows | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: ["ubuntu:24.04", "almalinux:9"] | |
container: | |
image: ${{ matrix.os }} | |
# Start PostgreSQL server | |
services: | |
postgres: | |
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 | |
steps: | |
# Install dependencies (Ubuntu 24.04) | |
- name: Install dependencies on Ubuntu 24.04 | |
if: matrix.os == 'ubuntu:24.04' | |
run: | | |
apt update -y | |
# Install dependencies of Open-COBOL-ESQL | |
apt install -y build-essential bison flex gettext texinfo automake autoconf curl libtool libpq-dev pkgconf | |
# Install dependencies of opensource COBOL | |
apt install -y libgmp-dev | |
# Install dependencies (Almalinux 9) | |
- name: Install dependencies on AlmaLinux 9 | |
if: matrix.os == 'almalinux:9' | |
run: | | |
dnf -y update | |
# Install dependencies of Open-COBOL-ESQL | |
dnf install -y gcc gcc-c++ make bison flex automake autoconf diffutils gettext libtool postgresql-devel | |
# Install dependencies of opensource COBOL | |
dnf install -y gmp-devel | |
# Cache the directory 'opensource-cobol-1.5.2J' | |
- name: Cache opnesource COBOL v1.5.2J | |
id: opensource_cobol_cache_id | |
uses: actions/cache@v4 | |
with: | |
path: opensource-cobol-1.5.2J | |
key: opensource-cobol-1.5.2J-key | |
# Build opensource COBOL if the cache is not found | |
- name: Download and Build opensource COBOL v1.5.2J | |
if: steps.opensource_cobol_cache_id.outputs.cache-hit != 'true' | |
run: | | |
curl -L -o opensource-cobol-1.5.2J.tar.gz https://github.com/opensourcecobol/opensource-cobol/archive/refs/tags/v1.5.2J.tar.gz | |
tar zxf opensource-cobol-1.5.2J.tar.gz | |
cd opensource-cobol-1.5.2J/vbisam | |
./configure --prefix=/usr/ | |
make | |
make install | |
cd ../ | |
./configure --prefix=/usr/ --with-vbisam | |
make | |
# Install opensource COBOL | |
- name: Install opensource COBOL v1.5.2J | |
run: | | |
cd opensource-cobol-1.5.2J/vbisam | |
make install | |
cd ../ | |
make install | |
# Checkout Open-COBOL-ESQL | |
- name: Checkout Open-COBOL-ESQL | |
uses: actions/checkout@v4 | |
with: | |
path: Open-COBOL-ESQL | |
# Build and Install Open-COBOL-ESQL | |
- name: Install Open-COBOL-ESQL | |
working-directory: Open-COBOL-ESQL | |
run: | | |
chmod +x ./autogen.sh && ./autogen.sh | |
./configure | |
make install | |
# Create a log directory | |
- name: Create a log directory | |
run: | | |
mkdir -p Open-COBOL-ESQL/log/test | |
# Run Autotest | |
- name: Run tests | |
working-directory: Open-COBOL-ESQL/tests | |
run: | | |
make clean | |
cp ../.github/workflows/test-settings/atlocal atlocal | |
cp ../.github/workflows/test-settings/embed_db_info.sh embed_db_info.sh | |
cp ../.github/workflows/test-settings/cobol_runner.sh cobol_runner.sh | |
make | |
./basic || cat basic.dir/*/*.log | |
./cobol_data | |
./sql_data | |
./sqlca | |
./misc | |
cp -r basic.dir cobol_data.dir sql_data.dir sqlca.dir ./*.log ../log/test | |
# Define the archive name | |
- name: Define the archive name | |
run: | | |
echo "OCESQL_ARCHIVE_NAME=ocesql-${{ matrix.os }}" | sed s/:/-/g >> "$GITHUB_ENV" | |
# Upload test logs and the result of static checking | |
- name: Archive Logs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.OCESQL_ARCHIVE_NAME }}.log | |
path: Open-COBOL-ESQL/log/* | |
# Workflow fails if one or more test cases failed | |
- name: Check test results | |
run: | | |
cat Open-COBOL-ESQL/tests/*.log | |
! cat Open-COBOL-ESQL/tests/*.log | grep -q 'Failed tests:' |