wakapi/.github/workflows/linux-build-on-release.yml

56 lines
1.2 KiB
YAML
Raw Normal View History

2021-09-17 14:21:09 +03:00
name: Linux
2020-05-31 11:29:15 +03:00
on:
push:
branches:
pull_request:
2020-05-31 11:29:15 +03:00
release:
types:
- published
2020-05-31 11:29:15 +03:00
jobs:
build-and-release:
2021-09-17 14:21:09 +03:00
name: Linux - Build, Test & Release
2020-05-31 11:29:15 +03:00
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
2022-03-20 18:39:38 +03:00
go-version: ^1.18
2020-05-31 11:29:15 +03:00
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
2021-09-17 14:21:09 +03:00
run: go get
- name: Unit Tests
run: go test ./... -run ./...
- name: API Tests
2020-05-31 11:29:15 +03:00
run: |
2021-09-17 14:21:09 +03:00
npm -g install newman
./testing/run_api_tests.sh
2020-05-31 11:29:15 +03:00
- name: Build
run: GO111MODULE=on go build -v .
- name: Zip executable and sample config
if: github.event_name == 'release'
run: |
cp config.default.yml config.yml
zip -9 release.zip wakapi config.yml
2020-05-31 11:29:15 +03:00
- name: Upload built executable to Release
if: github.event_name == 'release'
2020-05-31 11:29:15 +03:00
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: release.zip
asset_name: wakapi_linux_amd64.zip
asset_content_type: application/gzip