Files
cbsnexora-backend/.github/workflows/build-postgresql.yml
T
Janos HaberandArnold Gálovics d8fd8088b0 FINERACT-1707 - S3 export and dependent service
- [x] S3 export function
- [x] list all available export type services
- [x] refactor export service
- [x] unit test for export name generator
- [x] s3 integration test
- [x] localstack integration for testing
2023-02-06 19:53:00 +01:00

113 lines
4.4 KiB
YAML

name: Fineract Build & Test - PostgreSQL
on: [push, pull_request]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-20.04
services:
postgresql:
image: postgres:15.1
ports:
- 5432:5432
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: postgres
options: --health-cmd="pg_isready -q -d postgres -U root" --health-interval=5s --health-timeout=2s --health-retries=3
mock-oauth2-server:
image: ghcr.io/navikt/mock-oauth2-server:0.5.6
ports:
- 9000:9000
env:
SERVER_PORT: 9000
JSON_CONFIG: '{ "interactiveLogin": true, "httpServer": "NettyWrapper", "tokenCallbacks": [ { "issuerId": "auth/realms/fineract", "tokenExpiry": 120, "requestMappings": [{ "requestParam": "scope", "match": "fineract", "claims": { "sub": "mifos", "scope": [ "test" ] } } ] } ] }'
env:
TZ: Asia/Kolkata
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3
- name: Set up JDK 17
uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b # v3
with:
java-version: '17'
distribution: 'zulu'
cache: gradle
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # tag=v3
with:
node-version: 16
- name: Congfigure vega-cli
run: npm i -g vega-cli --unsafe
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@6c561573985cd8bd4d64efcfe270d51682d210e2
- name: Verify PostgreSQL connection
run: |
while ! pg_isready -d postgres -U root -h 127.0.0.1 -p 5432 ; do
sleep 1
done
- name: Initialise databases
run: |
./gradlew --no-daemon -q createPGDB -PdbName=fineract_tenants
./gradlew --no-daemon -q createPGDB -PdbName=fineract_default
- name: Start LocalStack
env:
AWS_ENDPOINT_URL: http://localhost:4566
AWS_ACCESS_KEY_ID: localstack
AWS_SECRET_ACCESS_KEY: localstack
AWS_REGION: us-east-1
run: |
echo "Update python pyopenssl"
pip install --upgrade pyopenssl
echo "Install localstack"
pip install localstack awscli-local[ver1] # install LocalStack cli and awslocal
docker pull localstack/localstack # Make sure to pull the latest version of the image
localstack start -d # Start LocalStack in the background
echo "Waiting for LocalStack startup..." # Wait 30 seconds for the LocalStack container
localstack wait -t 30 # to become ready before timing out
echo "Startup complete"
echo "Create fineract S3 bucket"
awslocal s3api create-bucket --bucket fineract-reports
echo "LocalStack initialization complete"
- name: Install additional software
run: |
sudo apt-get update
sudo apt-get install ghostscript graphviz -y
- name: Build & Test
env:
AWS_ENDPOINT_URL: http://localhost:4566
AWS_ACCESS_KEY_ID: localstack
AWS_SECRET_ACCESS_KEY: localstack
AWS_REGION: us-east-1
FINERACT_REPORT_EXPORT_S3_ENABLED: true
FINERACT_REPORT_EXPORT_S3_BUCKET_NAME: fineract-reports
run: |
./gradlew --no-daemon --console=plain build test --fail-fast -x doc -x :twofactor-tests:test -x :oauth2-test:test -PdbType=postgresql
./gradlew --no-daemon --console=plain :twofactor-tests:test --fail-fast -PdbType=postgresql
./gradlew --no-daemon --console=plain :oauth2-tests:test --fail-fast -PdbType=postgresql
- name: Archive test results
if: always()
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # tag=v3
with:
name: test-results
path: |
integration-tests/build/reports/
twofactor-tests/build/reports/
oauth2-tests/build/reports/
- name: Archive server logs
if: always()
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # tag=v3
with:
name: server-logs
path: |
integration-tests/build/cargo/
twofactor-tests/build/cargo/
oauth2-tests/build/cargo/