Update build.yml #106
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
# This workflow will build the project and run unit tests | |
name: Espm CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
maven: [ 3.6.3 ] | |
database-name: | |
- my-app | |
database-password: | |
- postgres | |
database-user: | |
- postgres | |
database-host: | |
- 127.0.0.1 | |
database-port: | |
- 5432 | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_DB: ${{ matrix.database-name }} | |
POSTGRES_USER: ${{ matrix.database-user }} | |
POSTGRES_PASSWORD: ${{ matrix.database-password }} | |
ports: | |
- 5432:5432 | |
options: | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Setup Apache Qpid Broker j | |
run: | | |
LATEST_VERSION=$(curl -s https://qpid.apache.org/download.html | grep -oP 'apache-qpid-broker-j-\K[0-9.]+(?=-bin.tar.gz)' | head -1) | |
wget https://downloads.apache.org/qpid/broker-j/${LATEST_VERSION}/binaries/apache-qpid-broker-j-${LATEST_VERSION}-bin.tar.gz | |
tar -xvzf apache-qpid-broker-j-${LATEST_VERSION}-bin.tar.gz | |
cd qpid-broker/9.2.0/bin/ | |
nohup ./qpid-server start & | |
- name: Update Qpid config | |
run: | | |
sudo sed -i '/"users" : \[/i\ \ \ \ "secureOnlyMechanisms": []' /home/runner/config.json | |
- name: Read QPID config | |
run: | | |
cat /home/runner/config.json | |
- name: QPID stop | |
run: | | |
nohup qpid-broker/9.2.0/bin/qpid.stop & | |
- name: QPID start | |
run: | | |
nohup qpid-broker/9.2.0/bin/qpid-server start & | |
- name: Build with Maven | |
run: mvn clean install | |
- name: espm customer service | |
run: | | |
cd /home/runner/work/cloud-espm-cloud-native/cloud-espm-cloud-native/customer-service | |
nohup mvn spring-boot:run & | |
- name: espm product service | |
run: | | |
cd /home/runner/work/cloud-espm-cloud-native/cloud-espm-cloud-native/product-service | |
nohup mvn spring-boot:run & | |
- name: espm worker | |
run: | | |
cd /home/runner/work/cloud-espm-cloud-native/cloud-espm-cloud-native/worker | |
nohup mvn spring-boot:run & | |
- name: espm sales service | |
run: | | |
cd /home/runner/work/cloud-espm-cloud-native/cloud-espm-cloud-native/sale-service | |
nohup mvn spring-boot:run & | |
- name: espm tax service | |
run: | | |
cd /home/runner/work/cloud-espm-cloud-native/cloud-espm-cloud-native/tax-service | |
nohup mvn spring-boot:run & | |
- name: espm gateway | |
run: | | |
cd /home/runner/work/cloud-espm-cloud-native/cloud-espm-cloud-native/ | |
nohup mvn clean install -pl gateway & | |
cd /home/runner/work/cloud-espm-cloud-native/cloud-espm-cloud-native/gateway | |
./node/npm start & | |
- name: Sleep for 30 seconds | |
run: sleep 30s | |
shell: bash | |
- name: Newman-apitest | |
run: | | |
npm install -g newman | |
newman run /home/runner/work/cloud-espm-cloud-native/cloud-espm-cloud-native/documentation/postman-collections/ESPM-LOCAL.postman_collection.json |