mirror of https://github.com/statping/statping
github actions
parent
b4b1b9b383
commit
205580fc2b
|
@ -10,10 +10,13 @@ jobs:
|
|||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v1
|
||||
- uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.14.x'
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '10.x'
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Add GOBIN to PATH
|
||||
run: |
|
||||
|
@ -21,17 +24,9 @@ jobs:
|
|||
echo ::set-env name=VERSION::$(cat version.txt)
|
||||
shell: bash
|
||||
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '10.x'
|
||||
|
||||
- name: Install Global Dependencies
|
||||
run: npm install -g yarn sass cross-env
|
||||
|
||||
- name: Checkout Statping Repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/cache@v1
|
||||
id: nodecache
|
||||
with:
|
||||
|
@ -65,23 +60,29 @@ jobs:
|
|||
- name: Build Frontend Statping
|
||||
run: make clean compile
|
||||
|
||||
- name: Upload Compiled Frontend (rice-box.go)
|
||||
- name: Upload Compiled Frontend Folder
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: static-frontend
|
||||
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:
|
||||
needs: compile
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Statping Repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v1
|
||||
- uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.14.x'
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '10.x'
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setting ENV's
|
||||
run: |
|
||||
|
@ -90,47 +91,31 @@ jobs:
|
|||
echo ::set-env name=VERSION::$(cat version.txt)
|
||||
shell: bash
|
||||
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '10.x'
|
||||
|
||||
- name: Install Global Dependencies
|
||||
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
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: static-frontend
|
||||
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
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
VERSION: ${{ env.VERSION }}
|
||||
run: |
|
||||
make build
|
||||
chmod +x statping
|
||||
mv statping $(go env GOPATH)/bin/
|
||||
|
||||
- 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:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
DB_CONN: sqlite3
|
||||
|
@ -167,18 +152,13 @@ jobs:
|
|||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Statping Repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v1
|
||||
- uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.14.x'
|
||||
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v1
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '10.x'
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/cache@v1
|
||||
id: golangcache
|
||||
|
@ -209,11 +189,17 @@ jobs:
|
|||
name: static-frontend
|
||||
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
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
COMMIT: $GITHUB_SHA
|
||||
run: make build-all
|
||||
run: make build-bin build-win
|
||||
|
||||
- name: Upload Release
|
||||
id: upload-release-asset
|
||||
|
|
Loading…
Reference in New Issue