Skip to content

Commit 7b29a8d

Browse files
committed
added workflow
1 parent ee353c8 commit 7b29a8d

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
pull_request:
6+
merge_group:
7+
8+
# limit the access of the generated GITHUB_TOKEN
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
lint:
14+
strategy:
15+
matrix:
16+
os: [windows-2022, windows-latest]
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
# See https://github.com/actions/setup-go/pull/515
21+
- uses: antontroshin/setup-go@bda02de8887c9946189f81e7e59512914aeb9ea4
22+
with:
23+
go-version-file: go.mod
24+
cache: true
25+
- name: install mage
26+
run: go install github.com/magefile/mage
27+
- run: |
28+
mage -debug check
29+
go vet ./...
30+
31+
update:
32+
strategy:
33+
matrix:
34+
os: [ windows-2022, windows-latest ]
35+
runs-on: ${{ matrix.os }}
36+
steps:
37+
- uses: actions/checkout@v4
38+
# See https://github.com/actions/setup-go/pull/515
39+
- uses: antontroshin/setup-go@bda02de8887c9946189f81e7e59512914aeb9ea4
40+
with:
41+
go-version-file: go.mod
42+
cache: true
43+
- name: install mage
44+
run: go install github.com/magefile/mage
45+
- name: install protoc
46+
run: |
47+
#curl -sSfL -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protoc-3.19.4-linux-x86_64.zip
48+
#mkdir -p $GITHUB_WORKSPACE/.protoc
49+
#unzip -o protoc.zip -d $GITHUB_WORKSPACE/.protoc
50+
#echo "$GITHUB_WORKSPACE/.protoc/bin" >> $GITHUB_PATH
51+
52+
$destination = "$GITHUB_WORKSPACE\protoc"
53+
$protoUri = "https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protoc-3.19.4-win64.zip
54+
"Write-Host "--- Setting up proto"
55+
if (-Not (Test-Path -Path $destination)) {
56+
New-Item -ItemType Directory -Path $destination | Out-Null
57+
}
58+
59+
Invoke-WebRequest -Uri $protoUri -OutFile "protoc.zip"
60+
Expand-Archive -Path "protoc.zip" -DestinationPath $destination -Force
61+
62+
$protocBinPath = Join-Path $destination "bin"
63+
if (-Not ($ENV:Path -contains $protocBinPath)) {
64+
$ENV:Path += ";$protocBinPath"
65+
}
66+
67+
mage -debug update
68+
go test -v -race ./...
69+
# - run: mage -debug update
70+
# - run: go test -v -race ./...

0 commit comments

Comments
 (0)