Mock API Server #612
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: Mock API Server | |
on: | |
schedule: | |
- cron: '00 20 * * *' | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
Mock-API-Node10: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, self-hosted] | |
runs-on: ${{ matrix.os }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build the Docker image Nodejs 10 | |
run: docker-compose -f "docker-compose.yml" up -d --build | |
env: | |
NODEJS_VERSION: 10 | |
APP_CODE_PATH_HOST: /tmp/app/ | |
- name: Node and NPM version check | |
run: | | |
docker exec mock-api-server_nodejs_1 node -v | |
docker exec mock-api-server_nodejs_1 npm -v | |
- name: API checking | |
run: | | |
sleep 30s | |
curl -i http://localhost:3000/v1/users | |
- name: Destroy container and file | |
run: | | |
docker-compose down | |
sudo rm -rf /tmp/app/ | |
echo "y" | docker image prune -a | |
- name: Slack Notification | |
uses: 8398a7/action-slack@v3 | |
with: | |
status: ${{ job.status }} | |
fields: repo,message,commit,author,action,eventName,ref,workflow | |
channel: '#github_action_status' | |
if: always() | |
# Mock-API-Node10-ARM64: | |
# runs-on: self-hosted | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Build the Docker image Nodejs 10 | |
# run: docker-compose -f "docker-compose.yml" up -d --build | |
# env: | |
# NODEJS_VERSION: 10 | |
# APP_CODE_PATH_HOST: /tmp/app/ | |
# - name: Node and NPM version check | |
# run: | | |
# docker exec mock-api-server_nodejs_1 node -v | |
# docker exec mock-api-server_nodejs_1 npm -v | |
# - name: API checking | |
# run: | | |
# sleep 30s | |
# curl -i http://localhost:3000/v1/users | |
# - name: Destroy container and file | |
# run: | | |
# docker-compose down | |
# echo "y" | docker system prune -a | |
# while [ -d /tmp/app ]; do | |
# echo "password" | sudo -S whoami | |
# sudo rm -rf /tmp/app/ | |
# done | |
Mock-API-Node12: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, self-hosted] | |
runs-on: ${{ matrix.os }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build the Docker image Nodejs 12 | |
run: docker-compose -f "docker-compose.yml" up -d --build | |
env: | |
NODEJS_VERSION: 12 | |
APP_CODE_PATH_HOST: /tmp/app/ | |
- name: Node and NPM version check | |
run: | | |
docker exec mock-api-server_nodejs_1 node -v | |
docker exec mock-api-server_nodejs_1 npm -v | |
- name: API checking | |
run: | | |
sleep 30s | |
curl -i http://localhost:3000/v1/users | |
- name: Destroy container and file | |
run: | | |
docker-compose down | |
sudo rm -rf /tmp/app/ | |
echo "y" | docker image prune -a | |
- name: Slack Notification | |
uses: 8398a7/action-slack@v3 | |
with: | |
status: ${{ job.status }} | |
fields: repo,message,commit,author,action,eventName,ref,workflow | |
channel: '#github_action_status' | |
if: always() | |
# Mock-API-Node12-ARM64: | |
# runs-on: self-hosted | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Build the Docker image Nodejs 12 | |
# run: docker-compose -f "docker-compose.yml" up -d --build | |
# env: | |
# NODEJS_VERSION: 12 | |
# APP_CODE_PATH_HOST: /tmp/app/ | |
# - name: Node and NPM version check | |
# run: | | |
# docker exec mock-api-server_nodejs_1 node -v | |
# docker exec mock-api-server_nodejs_1 npm -v | |
# - name: API checking | |
# run: | | |
# sleep 30s | |
# curl -i http://localhost:3000/v1/users | |
# - name: Destroy container and file | |
# run: | | |
# docker-compose down | |
# echo "y" | docker system prune -a | |
# while [ -d /tmp/app ]; do | |
# echo "password" | sudo -S whoami | |
# sudo rm -rf /tmp/app/ | |
# done | |
Mock-API-Node13: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, self-hosted] | |
runs-on: ${{ matrix.os }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build the Docker image Nodejs 13 | |
run: docker-compose -f "docker-compose.yml" up -d --build | |
env: | |
NODEJS_VERSION: 13 | |
APP_CODE_PATH_HOST: /tmp/app/ | |
- name: Node and NPM version check | |
run: | | |
docker exec mock-api-server_nodejs_1 node -v | |
docker exec mock-api-server_nodejs_1 npm -v | |
- name: API checking | |
run: | | |
sleep 30s | |
curl -i http://localhost:3000/v1/users | |
- name: Destroy container and file | |
run: | | |
docker-compose down | |
sudo rm -rf /tmp/app/ | |
echo "y" | docker image prune -a | |
- name: Slack Notification | |
uses: 8398a7/action-slack@v3 | |
with: | |
status: ${{ job.status }} | |
fields: repo,message,commit,author,action,eventName,ref,workflow | |
channel: '#github_action_status' | |
if: always() | |
# Mock-API-Node13-ARM64: | |
# runs-on: self-hosted | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Build the Docker image Nodejs 13 | |
# run: docker-compose -f "docker-compose.yml" up -d --build | |
# env: | |
# NODEJS_VERSION: 13 | |
# APP_CODE_PATH_HOST: /tmp/app/ | |
# - name: Node and NPM version check | |
# run: | | |
# docker exec mock-api-server_nodejs_1 node -v | |
# docker exec mock-api-server_nodejs_1 npm -v | |
# - name: API checking | |
# run: | | |
# sleep 30s | |
# curl -i http://localhost:3000/v1/users | |
# - name: Destroy container and file | |
# run: | | |
# docker-compose down | |
# echo "y" | docker system prune -a | |
# while [ -d /tmp/app ]; do | |
# echo "password" | sudo -S whoami | |
# sudo rm -rf /tmp/app/ | |
# done | |
Mock-API-Node14: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, self-hosted] | |
runs-on: ${{ matrix.os }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build the Docker image Nodejs 14 | |
run: docker-compose -f "docker-compose.yml" up -d --build | |
env: | |
NODEJS_VERSION: 14 | |
APP_CODE_PATH_HOST: /tmp/app/ | |
- name: Node and NPM version check | |
run: | | |
docker exec mock-api-server_nodejs_1 node -v | |
docker exec mock-api-server_nodejs_1 npm -v | |
- name: API checking | |
run: | | |
sleep 30s | |
curl -i http://localhost:3000/v1/users | |
- name: Destroy container and file | |
run: | | |
docker-compose down | |
sudo rm -rf /tmp/app/ | |
echo "y" | docker image prune -a | |
- name: Slack Notification | |
uses: 8398a7/action-slack@v3 | |
with: | |
status: ${{ job.status }} | |
fields: repo,message,commit,author,action,eventName,ref,workflow | |
channel: '#github_action_status' | |
if: always() | |
# Mock-API-Node14-ARM64: | |
# runs-on: self-hosted | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Build the Docker image Nodejs 14 | |
# run: docker-compose -f "docker-compose.yml" up -d --build | |
# env: | |
# NODEJS_VERSION: 14 | |
# APP_CODE_PATH_HOST: /tmp/app/ | |
# - name: Node and NPM version check | |
# run: | | |
# docker exec mock-api-server_nodejs_1 node -v | |
# docker exec mock-api-server_nodejs_1 npm -v | |
# - name: API checking | |
# run: | | |
# sleep 30s | |
# curl -i http://localhost:3000/v1/users | |
# - name: Destroy container and file | |
# run: | | |
# docker-compose down | |
# echo "y" | docker system prune -a | |
# while [ -d /tmp/app ]; do | |
# echo "password" | sudo -S whoami | |
# sudo rm -rf /tmp/app/ | |
# done | |
Mock-API-Node16: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, self-hosted] | |
runs-on: ${{ matrix.os }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build the Docker image Nodejs 16 | |
run: docker-compose -f "docker-compose.yml" up -d --build | |
env: | |
NODEJS_VERSION: 16 | |
APP_CODE_PATH_HOST: /tmp/app/ | |
- name: Node and NPM version check | |
run: | | |
docker exec mock-api-server_nodejs_1 node -v | |
docker exec mock-api-server_nodejs_1 npm -v | |
- name: API checking | |
run: | | |
sleep 30s | |
curl -i http://localhost:3000/v1/users | |
- name: Destroy container and file | |
run: | | |
docker-compose down | |
sudo rm -rf /tmp/app/ | |
echo "y" | docker image prune -a | |
- name: Slack Notification | |
uses: 8398a7/action-slack@v3 | |
with: | |
status: ${{ job.status }} | |
fields: repo,message,commit,author,action,eventName,ref,workflow | |
channel: '#github_action_status' | |
if: always() | |
# Mock-API-Node16-ARM64: | |
# runs-on: self-hosted | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Build the Docker image Nodejs 16 | |
# run: docker-compose -f "docker-compose.yml" up -d --build | |
# env: | |
# NODEJS_VERSION: 16 | |
# APP_CODE_PATH_HOST: /tmp/app/ | |
# - name: Node and NPM version check | |
# run: | | |
# docker exec mock-api-server_nodejs_1 node -v | |
# docker exec mock-api-server_nodejs_1 npm -v | |
# - name: API checking | |
# run: | | |
# sleep 30s | |
# curl -i http://localhost:3000/v1/users | |
# - name: Destroy container and file | |
# run: | | |
# docker-compose down | |
# echo "y" | docker system prune -a | |
# while [ -d /tmp/app ]; do | |
# echo "password" | sudo -S whoami | |
# sudo rm -rf /tmp/app/ | |
# done | |
Mock-API-Node17: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, self-hosted] | |
runs-on: ${{ matrix.os }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build the Docker image Nodejs 17 | |
run: docker-compose -f "docker-compose.yml" up -d --build | |
env: | |
NODEJS_VERSION: 17 | |
APP_CODE_PATH_HOST: /tmp/app/ | |
- name: Node and NPM version check | |
run: | | |
docker exec mock-api-server_nodejs_1 node -v | |
docker exec mock-api-server_nodejs_1 npm -v | |
- name: API checking | |
run: | | |
sleep 30s | |
curl -i http://localhost:3000/v1/users | |
- name: Destroy container and file | |
run: | | |
docker-compose down | |
sudo rm -rf /tmp/app/ | |
echo "y" | docker image prune -a | |
- name: Slack Notification | |
uses: 8398a7/action-slack@v3 | |
with: | |
status: ${{ job.status }} | |
fields: repo,message,commit,author,action,eventName,ref,workflow | |
channel: '#github_action_status' | |
if: always() | |
# Mock-API-Node17-ARM64: | |
# runs-on: self-hosted | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Build the Docker image Nodejs 17 | |
# run: docker-compose -f "docker-compose.yml" up -d --build | |
# env: | |
# NODEJS_VERSION: 17 | |
# APP_CODE_PATH_HOST: /tmp/app/ | |
# - name: Node and NPM version check | |
# run: | | |
# docker exec mock-api-server_nodejs_1 node -v | |
# docker exec mock-api-server_nodejs_1 npm -v | |
# - name: API checking | |
# run: | | |
# sleep 30s | |
# curl -i http://localhost:3000/v1/users | |
# - name: Destroy container and file | |
# run: | | |
# docker-compose down | |
# echo "y" | docker system prune -a | |
# while [ -d /tmp/app ]; do | |
# echo "password" | sudo -S whoami | |
# sudo rm -rf /tmp/app/ | |
# done | |
Mock-API-Node18: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, self-hosted] | |
runs-on: ${{ matrix.os }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build the Docker image Nodejs 18 | |
run: docker-compose -f "docker-compose.yml" up -d --build | |
env: | |
NODEJS_VERSION: 18 | |
APP_CODE_PATH_HOST: /tmp/app/ | |
- name: Node and NPM version check | |
run: | | |
docker exec mock-api-server_nodejs_1 node -v | |
docker exec mock-api-server_nodejs_1 npm -v | |
- name: API checking | |
run: | | |
sleep 30s | |
curl -i http://localhost:3000/v1/users | |
- name: Destroy container and file | |
run: | | |
docker-compose down | |
sudo rm -rf /tmp/app/ | |
echo "y" | docker image prune -a | |
- name: Slack Notification | |
uses: 8398a7/action-slack@v3 | |
with: | |
status: ${{ job.status }} | |
fields: repo,message,commit,author,action,eventName,ref,workflow | |
channel: '#github_action_status' | |
if: always() | |
# Mock-API-Node18-ARM64: | |
# runs-on: self-hosted | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Build the Docker image Nodejs 18 | |
# run: docker-compose -f "docker-compose.yml" up -d --build | |
# env: | |
# NODEJS_VERSION: 18 | |
# APP_CODE_PATH_HOST: /tmp/app/ | |
# - name: Node and NPM version check | |
# run: | | |
# docker exec mock-api-server_nodejs_1 node -v | |
# docker exec mock-api-server_nodejs_1 npm -v | |
# - name: API checking | |
# run: | | |
# sleep 30s | |
# curl -i http://localhost:3000/v1/users | |
# - name: Destroy container and file | |
# run: | | |
# docker-compose down | |
# echo "y" | docker system prune -a | |
# while [ -d /tmp/app ]; do | |
# echo "password" | sudo -S whoami | |
# sudo rm -rf /tmp/app/ | |
# done | |
Mock-API-Node19: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, self-hosted] | |
runs-on: ${{ matrix.os }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build the Docker image Nodejs 19 | |
run: docker-compose -f "docker-compose.yml" up -d --build | |
env: | |
NODEJS_VERSION: 19 | |
APP_CODE_PATH_HOST: /tmp/app/ | |
- name: Node and NPM version check | |
run: | | |
docker exec mock-api-server_nodejs_1 node -v | |
docker exec mock-api-server_nodejs_1 npm -v | |
- name: API checking | |
run: | | |
sleep 30s | |
curl -i http://localhost:3000/v1/users | |
- name: Destroy container and file | |
run: | | |
docker-compose down | |
sudo rm -rf /tmp/app/ | |
echo "y" | docker image prune -a | |
- name: Slack Notification | |
uses: 8398a7/action-slack@v3 | |
with: | |
status: ${{ job.status }} | |
fields: repo,message,commit,author,action,eventName,ref,workflow | |
channel: '#github_action_status' | |
if: always() | |
# Mock-API-Node19-ARM64: | |
# runs-on: self-hosted | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Build the Docker image Nodejs 19 | |
# run: docker-compose -f "docker-compose.yml" up -d --build | |
# env: | |
# NODEJS_VERSION: 19 | |
# APP_CODE_PATH_HOST: /tmp/app/ | |
# - name: Node and NPM version check | |
# run: | | |
# docker exec mock-api-server_nodejs_1 node -v | |
# docker exec mock-api-server_nodejs_1 npm -v | |
# - name: API checking | |
# run: | | |
# sleep 30s | |
# curl -i http://localhost:3000/v1/users | |
# - name: Destroy container and file | |
# run: | | |
# docker-compose down | |
# echo "y" | docker system prune -a | |
# while [ -d /tmp/app ]; do | |
# echo "password" | sudo -S whoami | |
# sudo rm -rf /tmp/app/ | |
# done |