1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

chore: merge mapi, test, build to ci.yml & keep release in release.yml

This commit is contained in:
daief 2022-05-20 11:46:29 +08:00
parent 3b87511f48
commit 4a4d0dad4b
2 changed files with 56 additions and 33 deletions

View File

@ -1,5 +1,4 @@
name: 'Mayhem for API'
name: ci
on:
push:
branches: [ master ]
@ -9,8 +8,31 @@ on:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: go get
- name: Unit Tests
run: go test ./... -run ./...
- name: API Tests
run: |
npm -g install newman
./testing/run_api_tests.sh
mapi:
name: 'Mayhem for API'
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
@ -50,3 +72,26 @@ jobs:
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: mapi.sarif
build:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: go get
- name: Build
run: go build -v .

View File

@ -1,16 +1,13 @@
name: Release
on:
push:
branches:
pull_request:
release:
types:
- published
jobs:
build-and-release:
name: Build & Release
release:
name: Release
strategy:
fail-fast: false
matrix:
@ -36,20 +33,7 @@ jobs:
uses: actions/checkout@v2
- name: Get dependencies
run: |
go get
- name: Enable Go 1.11 modules
if: runner.os == 'Windows'
run: cmd /c "set GO111MODULE=on"
- name: Unit Tests
run: go test ./... -run ./...
- name: API Tests
run: |
npm -g install newman
./testing/run_api_tests.sh
run: go get
- name: Build
run: go build -v .
@ -66,12 +50,6 @@ jobs:
zip -9 release.zip wakapi config.yml
- name: Upload built executable to Release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: release.zip
asset_name: wakapi_${{ matrix.alias }}_amd64.zip
asset_content_type: application/gzip
files: wakapi_${{ matrix.alias }}_amd64.zip