mirror of https://github.com/statping/statping
workflow
parent
7c24adfd27
commit
1a48baa99f
|
@ -270,14 +270,109 @@ jobs:
|
||||||
env:
|
env:
|
||||||
COVERALLS: ${{ secrets.COVERALLS }}
|
COVERALLS: ${{ secrets.COVERALLS }}
|
||||||
|
|
||||||
|
test-postman-sqlite:
|
||||||
test-postman:
|
needs: frontend
|
||||||
needs: [frontend, build]
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
steps:
|
||||||
matrix:
|
- uses: actions/checkout@v2
|
||||||
platform: [postman_env_sqlite.json]
|
- uses: actions/setup-go@v2
|
||||||
# platform: [postman_env_sqlite.json, postman_env_postgres.json, postman_env_mysql.json]
|
with:
|
||||||
|
go-version: 1.15.x
|
||||||
|
|
||||||
|
- name: Setting ENV's
|
||||||
|
run: |
|
||||||
|
echo "::add-path::$(go env GOPATH)/bin"
|
||||||
|
echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin"
|
||||||
|
echo ::set-env name=VERSION::$(cat version.txt)
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
|
uses: actions/download-artifact@v1
|
||||||
|
with:
|
||||||
|
name: static-rice-box
|
||||||
|
path: ./source
|
||||||
|
|
||||||
|
- name: Install Statping
|
||||||
|
env:
|
||||||
|
VERSION: ${{ env.VERSION }}
|
||||||
|
COMMIT: ${{ github.sha }}
|
||||||
|
run: |
|
||||||
|
make build
|
||||||
|
chmod +x statping
|
||||||
|
mv statping $(go env GOPATH)/bin/
|
||||||
|
- name: Run Statping
|
||||||
|
run: |
|
||||||
|
API_SECRET=demosecret123 statping --port=8585 > /dev/null &
|
||||||
|
sleep 5
|
||||||
|
- name: Postman SQLite Tests
|
||||||
|
uses: matt-ball/newman-action@master
|
||||||
|
with:
|
||||||
|
apiKey: ${{ secrets.POSTMAN_API }}
|
||||||
|
collection: ./dev/postman.json
|
||||||
|
environment: ./dev/postman_env_sqlite.json
|
||||||
|
timeoutRequest: 30000
|
||||||
|
delayRequest: 600
|
||||||
|
|
||||||
|
test-postman-mysql:
|
||||||
|
needs: frontend
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mysql:5.7
|
||||||
|
env:
|
||||||
|
MYSQL_ROOT_PASSWORD: password123
|
||||||
|
MYSQL_DATABASE: statping
|
||||||
|
ports:
|
||||||
|
- 3306:3306
|
||||||
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.15.x
|
||||||
|
|
||||||
|
- name: Setting ENV's
|
||||||
|
run: |
|
||||||
|
echo "::add-path::$(go env GOPATH)/bin"
|
||||||
|
echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin"
|
||||||
|
echo ::set-env name=VERSION::$(cat version.txt)
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
|
uses: actions/download-artifact@v1
|
||||||
|
with:
|
||||||
|
name: static-rice-box
|
||||||
|
path: ./source
|
||||||
|
|
||||||
|
- name: Install Statping
|
||||||
|
env:
|
||||||
|
VERSION: ${{ env.VERSION }}
|
||||||
|
COMMIT: ${{ github.sha }}
|
||||||
|
MJML_APP: ${{ secrets.MJML_APP }}
|
||||||
|
MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }}
|
||||||
|
run: |
|
||||||
|
make build
|
||||||
|
chmod +x statping
|
||||||
|
mv statping $(go env GOPATH)/bin/
|
||||||
|
- name: Run Statping
|
||||||
|
run: |
|
||||||
|
API_SECRET=demosecret123 statping --port=8585 > /dev/null &
|
||||||
|
sleep 5
|
||||||
|
- name: Postman MySQL Tests
|
||||||
|
uses: matt-ball/newman-action@master
|
||||||
|
with:
|
||||||
|
apiKey: ${{ secrets.POSTMAN_API }}
|
||||||
|
collection: ./dev/postman.json
|
||||||
|
environment: ./dev/postman_env_mysql.json
|
||||||
|
timeoutRequest: 30000
|
||||||
|
delayRequest: 600
|
||||||
|
|
||||||
|
test-postman-postgres:
|
||||||
|
needs: frontend
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:10.8
|
image: postgres:10.8
|
||||||
|
@ -288,47 +383,49 @@ jobs:
|
||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||||
mysql:
|
|
||||||
image: mysql:5.7
|
|
||||||
env:
|
|
||||||
MYSQL_ROOT_PASSWORD: password123
|
|
||||||
MYSQL_DATABASE: statping
|
|
||||||
ports:
|
|
||||||
- 3306:3306
|
|
||||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.15.x
|
||||||
|
|
||||||
- name: Download Statping
|
- name: Setting ENV's
|
||||||
|
run: |
|
||||||
|
echo "::add-path::$(go env GOPATH)/bin"
|
||||||
|
echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin"
|
||||||
|
echo ::set-env name=VERSION::$(cat version.txt)
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: statping-linux-amd64
|
name: static-rice-box
|
||||||
path: ./build
|
path: ./source
|
||||||
|
|
||||||
- name: Install Statping
|
- name: Install Statping
|
||||||
|
env:
|
||||||
|
VERSION: ${{ env.VERSION }}
|
||||||
|
COMMIT: ${{ github.sha }}
|
||||||
run: |
|
run: |
|
||||||
cd build && tar -xvf statping-linux-amd64.tar.gz
|
make build
|
||||||
mv statping ../
|
chmod +x statping
|
||||||
|
mv statping $(go env GOPATH)/bin/
|
||||||
- name: Get Statping Version
|
|
||||||
run: ./statping version
|
|
||||||
|
|
||||||
- name: Run Statping
|
- name: Run Statping
|
||||||
run: |
|
run: |
|
||||||
API_SECRET=demosecret123 ./statping --ip=0.0.0.0 --port=8585 > /dev/null &
|
API_SECRET=demosecret123 statping --port=8585 > /dev/null &
|
||||||
sleep 15
|
sleep 5
|
||||||
|
- name: Postman Postgres Tests
|
||||||
- name: Postman Tests
|
|
||||||
uses: matt-ball/newman-action@master
|
uses: matt-ball/newman-action@master
|
||||||
with:
|
with:
|
||||||
apiKey: ${{ secrets.POSTMAN_API }}
|
apiKey: ${{ secrets.POSTMAN_API }}
|
||||||
collection: ./dev/postman.json
|
collection: ./dev/postman.json
|
||||||
environment: ./dev/${{ matrix.platform }}
|
environment: ./dev/postman_env_postgres.json
|
||||||
timeoutRequest: 60000
|
timeoutRequest: 30000
|
||||||
delayRequest: 600
|
delayRequest: 600
|
||||||
|
|
||||||
sentry-release:
|
sentry-release:
|
||||||
needs: [test, test-postman]
|
needs: [test, test-postman-sqlite, test-postman-postgres, test-postman-mysql]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Statping Repo
|
- name: Checkout Statping Repo
|
||||||
|
|
|
@ -254,64 +254,8 @@ jobs:
|
||||||
env:
|
env:
|
||||||
COVERALLS: ${{ secrets.COVERALLS }}
|
COVERALLS: ${{ secrets.COVERALLS }}
|
||||||
|
|
||||||
|
|
||||||
test-postman:
|
|
||||||
needs: [frontend, build]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
platform: [postman_env_sqlite.json, postman_env_postgres.json, postman_env_mysql.json]
|
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:10.8
|
|
||||||
env:
|
|
||||||
POSTGRES_USER: root
|
|
||||||
POSTGRES_PASSWORD: password123
|
|
||||||
POSTGRES_DB: statping
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
||||||
mysql:
|
|
||||||
image: mysql:5.7
|
|
||||||
env:
|
|
||||||
MYSQL_ROOT_PASSWORD: password123
|
|
||||||
MYSQL_DATABASE: statping
|
|
||||||
ports:
|
|
||||||
- 3306:3306
|
|
||||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Download Statping
|
|
||||||
uses: actions/download-artifact@v1
|
|
||||||
with:
|
|
||||||
name: statping-linux-amd64
|
|
||||||
path: ./build
|
|
||||||
|
|
||||||
- name: Install Statping
|
|
||||||
env:
|
|
||||||
VERSION: ${{ env.VERSION }}
|
|
||||||
COMMIT: ${{ github.sha }}
|
|
||||||
run: |
|
|
||||||
cd build && tar -xvf statping-linux-amd64.tar.gz
|
|
||||||
mv statping ../
|
|
||||||
|
|
||||||
- name: Run Statping
|
|
||||||
run: |
|
|
||||||
API_SECRET=demosecret123 ./statping --ip=0.0.0.0 --port=8585 > /dev/null &
|
|
||||||
sleep 15
|
|
||||||
|
|
||||||
- name: Postman Tests
|
|
||||||
uses: matt-ball/newman-action@master
|
|
||||||
with:
|
|
||||||
apiKey: ${{ secrets.POSTMAN_API }}
|
|
||||||
collection: ./dev/postman.json
|
|
||||||
environment: ./dev/${{ matrix.platform }}
|
|
||||||
timeoutRequest: 30000
|
|
||||||
delayRequest: 600
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [build, test, test-postman]
|
needs: [build, test]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
|
@ -6,6 +6,13 @@ on:
|
||||||
- '*/*' # matches every branch containing a single '/'
|
- '*/*' # matches every branch containing a single '/'
|
||||||
- '!master' # excludes master
|
- '!master' # excludes master
|
||||||
- '!dev' # excludes dev
|
- '!dev' # excludes dev
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- '*' # matches every branch
|
||||||
|
- '*/*' # matches every branch containing a single '/'
|
||||||
|
- '!master' # excludes master
|
||||||
|
- '!dev' # excludes dev
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
compile:
|
compile:
|
||||||
|
|
Loading…
Reference in New Issue