-
Notifications
You must be signed in to change notification settings - Fork 39
72 lines (56 loc) · 1.86 KB
/
test.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
69
70
71
72
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.22.x', '1.23.x']
test-task: ['test', 'test-e2e']
steps:
- uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v1
- name: Install protobuf
run: |
version=3.10.0
archive=protoc-${version}-linux-x86_64
curl -O -L https://github.com/protocolbuffers/protobuf/releases/download/v${version}/${archive}.zip
sudo unzip -d '/usr/local' ${archive}.zip 'bin/*' 'include/*'
rm -rf $archive.zip
protoc --version
if: matrix.test-task == 'test-e2e'
- run: go mod download
- run: echo "TARGET_REVISION=${{ github.sha }}" >> $GITHUB_ENV
if: "github.event.push"
- run: echo "GRAPI_URL=$(pwd)" >> $GITHUB_ENV
if: "!github.event.push"
- run: make ${{ matrix.test-task }}
env:
COVER: ${{ matrix.go-version == '1.23.x' && matrix.test-task == 'test' }}
- run: curl -s https://codecov.io/bash | bash -s -- -t $CODECOV_TOKEN
if: matrix.go-version == '1.23.x' && matrix.test-task == 'test'
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
with:
go-version: 1.23
- uses: actions/checkout@v1
- run: go mod download
- uses: izumin5210/action-go-crossbuild@releases/v1
with:
package: ./cmd/grapi
- uses: softprops/action-gh-release@v1
with:
files: './dist/*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
- uses: izumin5210/action-homebrew@releases/v0
with:
tap: izumin5210/homebrew-tools
token: ${{ secrets.GITHUB_TOKEN }}
tap-token: ${{ secrets.TAP_GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')