Skip to content

Feature/apcv 756

Feature/apcv 756 #142

Workflow file for this run

name: DCSA-OVS MASTER CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: DCSA-OVS
submodules: recursive
- name: Set up Java JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: maven-settings-xml-action
uses: whelk-io/maven-settings-xml-action@v12
with:
repositories: '[{ "id": "github", "name": "DCSA Backend repo", "url": "https://maven.pkg.github.com/dcsaorg/DCSA-Core", "releases": { "enabled": "true" }, "snapshots": { "enabled": "true" } }]'
servers: '[{ "id": "github", "username": "${{ secrets.DCSA_USER }}", "password": "${{ secrets.DCSA_PACKAGES_PAT }}" }]'
- name: Build OVS
run: cd DCSA-OVS && mvn clean -U -B package -Ddcsa.artifacttype=-SNAPSHOT
- name: Build and run the microservices
run: cd DCSA-OVS && docker-compose -f docker-compose.yml up -d -V --build
- name: Fetch Backend Status
run: |
sleep 10
status=$(curl -s http://localhost:9090/ovs/v3/actuator/health | jq -r '.status')
retries=12
while [[ "$status" != "UP" ]] && [[ $retries -gt 0 ]]; do
echo "Status is '$status' - waiting 5 secs ($retries retries left)"
sleep 5
retries=$((retries - 1))
status=$(curl -s http://localhost:9090/ovs/v3/actuator/health | jq -r '.status')
done
echo "Final status is '$status'"
if [[ "$status" != "UP" ]]; then
curl -v http://localhost:9090/ovs/v3/actuator/health
docker ps
docker logs dcsa_ovs
fi
echo "::set-output name=STATUS::$status"
id: healthcheck
- name: Confirm microservice status
if: ${{ steps.healthcheck.outputs.STATUS == 'UP' }}
run: |
echo "The DCSA-OVS service is UP."
#- name: Confirm microservice status
# if: ${{ steps.healthcheck.outputs.STATUS != 'UP' }}
# uses: actions/github-script@v3
# with:
# script: |
# core.setFailed('The DCSA-OVS service is down.')
- name: Run Postman Integration Tests
uses: anthonyvscode/newman-action@v1
with:
collection: DCSA-OVS/postman_collection.json
reporters: cli