-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (66 loc) · 1.83 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
name: Go
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
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: Prepare simulator
run: |
curl -L https://github.com/slytomcat/yandex-disk-simulator/releases/latest/download/yandex-disk-simulator > yandex-disk
chmod a+x yandex-disk
- name: Test
run: |
export PATH=$(pwd):$PATH
go test -v --race -coverprofile cover.out ./...
- name: Format coverage
run: go tool cover -html=cover.out -o coverage.html
- name: Upload coverage to Artifacts
uses: actions/upload-artifact@v4
with:
name: coverage_artifacts
path: coverage.html
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 amd64
run: |
GOOS=linux GOARCH=amd64 ./build.sh
- name: Upload a Build Artifacts
uses: actions/upload-artifact@v4
with:
name: build_artifacts
path: |
yd-go
push:
needs: [build, test]
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/[email protected]
with:
name: build_artifacts
- name: draft new release and upload assets
env:
GH_TOKEN: ${{ secrets.TOKEN }}
run: |
gh release create "$(git branch --show-current)-$(git rev-parse --short HEAD)" ./yd-go