forked from Gavinpub/ws
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (67 loc) · 1.97 KB
/
go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Go
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
- name: Requirements
run: sudo apt-get install upx-ucl
- name: Build
run: ./build.sh
- name: Upload a Build Artifacts
uses: actions/upload-artifact@v4
with:
name: build_artifacts
path: |
ws
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
- name: Test ws
run: go test -v -coverprofile cover.out .
- name: Format ws coverage
run: go tool cover -html=cover.out -o coverage.html
- name: Test server
run: go test -v -coverprofile cover_server.out ./server
- name: Format ws coverage
run: go tool cover -html=cover_server.out -o coverage_server.html
- name: Test ws
run: go test -v -coverprofile cover_echo-server.out ./echo-server
- name: Format ws coverage
run: go tool cover -html=cover_echo-server.out -o coverage_echo-server.html
- name: Upload coverage to Artifacts
uses: actions/upload-artifact@v4
with:
name: coverage_artifacts
path: |
coverage.html
coverage_server.html
coverage_echo-server.html
push:
needs: [build, test]
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: build_artifacts
- name: Draft new release and upload assets
env:
GH_TOKEN: ${{ secrets.ACTION_TOKEN }}
run: |
gh release create "$(git branch --show-current)-$(git rev-parse --short HEAD)" ./ws