mirror of https://github.com/statping/statping
github actions
parent
b4b1b9b383
commit
205580fc2b
|
@ -10,10 +10,13 @@ jobs:
|
||||||
compile:
|
compile:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install Go
|
- uses: actions/setup-go@v1
|
||||||
uses: actions/setup-go@v1
|
|
||||||
with:
|
with:
|
||||||
go-version: '1.14.x'
|
go-version: '1.14.x'
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: '10.x'
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Add GOBIN to PATH
|
- name: Add GOBIN to PATH
|
||||||
run: |
|
run: |
|
||||||
|
@ -21,17 +24,9 @@ jobs:
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo ::set-env name=VERSION::$(cat version.txt)
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Install Node
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: '10.x'
|
|
||||||
|
|
||||||
- name: Install Global Dependencies
|
- name: Install Global Dependencies
|
||||||
run: npm install -g yarn sass cross-env
|
run: npm install -g yarn sass cross-env
|
||||||
|
|
||||||
- name: Checkout Statping Repo
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1
|
||||||
id: nodecache
|
id: nodecache
|
||||||
with:
|
with:
|
||||||
|
@ -65,23 +60,29 @@ jobs:
|
||||||
- name: Build Frontend Statping
|
- name: Build Frontend Statping
|
||||||
run: make clean compile
|
run: make clean compile
|
||||||
|
|
||||||
- name: Upload Compiled Frontend (rice-box.go)
|
- name: Upload Compiled Frontend Folder
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: static-frontend
|
name: static-frontend
|
||||||
path: /home/runner/work/statping/statping/source/dist
|
path: /home/runner/work/statping/statping/source/dist
|
||||||
|
|
||||||
|
- name: Upload Compiled Frontend (rice-box.go)
|
||||||
|
uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: static-rice-box
|
||||||
|
path: /home/runner/work/statping/statping/source/rice-box.go
|
||||||
|
|
||||||
test:
|
test:
|
||||||
needs: compile
|
needs: compile
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Statping Repo
|
- uses: actions/setup-go@v1
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v1
|
|
||||||
with:
|
with:
|
||||||
go-version: '1.14.x'
|
go-version: '1.14.x'
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: '10.x'
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: |
|
run: |
|
||||||
|
@ -90,37 +91,21 @@ jobs:
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo ::set-env name=VERSION::$(cat version.txt)
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Install Node
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: '10.x'
|
|
||||||
|
|
||||||
- name: Install Global Dependencies
|
- name: Install Global Dependencies
|
||||||
run: npm install -g yarn sass newman cross-env wait-on @sentry/cli
|
run: npm install -g yarn sass newman cross-env wait-on @sentry/cli
|
||||||
|
|
||||||
- uses: actions/cache@v1
|
|
||||||
id: golangcache
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/go/pkg/mod
|
|
||||||
~/go/bin
|
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
|
|
||||||
- name: Download Go mods
|
|
||||||
if: steps.golangcache.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
go mod download
|
|
||||||
go mod verify
|
|
||||||
make test-deps
|
|
||||||
|
|
||||||
- name: Download Compiled Frontend
|
- name: Download Compiled Frontend
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: static-frontend
|
name: static-frontend
|
||||||
path: /home/runner/work/statping/statping/source/dist
|
path: /home/runner/work/statping/statping/source/dist
|
||||||
|
|
||||||
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
|
uses: actions/download-artifact@v1
|
||||||
|
with:
|
||||||
|
name: static-rice-box
|
||||||
|
path: /home/runner/work/statping/statping/source/rice-box.go
|
||||||
|
|
||||||
- name: Install Statping
|
- name: Install Statping
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
|
@ -130,7 +115,7 @@ jobs:
|
||||||
mv statping $(go env GOPATH)/bin/
|
mv statping $(go env GOPATH)/bin/
|
||||||
|
|
||||||
- name: Go Tests
|
- name: Go Tests
|
||||||
run: SASS=`which sass` go test -v -covermode=count -coverprofile=coverage.out -p=1 ./...
|
run: go test -v -covermode=count -coverprofile=coverage.out -p=1 ./...
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
DB_CONN: sqlite3
|
DB_CONN: sqlite3
|
||||||
|
@ -167,18 +152,13 @@ jobs:
|
||||||
needs: test
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Statping Repo
|
- uses: actions/setup-go@v1
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v1
|
|
||||||
with:
|
with:
|
||||||
go-version: '1.14.x'
|
go-version: '1.14.x'
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
- name: Install Node
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
with:
|
||||||
node-version: '10.x'
|
node-version: '10.x'
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1
|
||||||
id: golangcache
|
id: golangcache
|
||||||
|
@ -209,11 +189,17 @@ jobs:
|
||||||
name: static-frontend
|
name: static-frontend
|
||||||
path: /home/runner/work/statping/statping/source/dist
|
path: /home/runner/work/statping/statping/source/dist
|
||||||
|
|
||||||
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
|
uses: actions/download-artifact@v1
|
||||||
|
with:
|
||||||
|
name: static-rice-box
|
||||||
|
path: /home/runner/work/statping/statping/source/rice-box.go
|
||||||
|
|
||||||
- name: Build Binaries
|
- name: Build Binaries
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
COMMIT: $GITHUB_SHA
|
COMMIT: $GITHUB_SHA
|
||||||
run: make build-all
|
run: make build-bin build-win
|
||||||
|
|
||||||
- name: Upload Release
|
- name: Upload Release
|
||||||
id: upload-release-asset
|
id: upload-release-asset
|
||||||
|
|
Loading…
Reference in New Issue