Skip to content

added workflow

added workflow #26

Workflow file for this run

name: ci
on:
push:
pull_request:
merge_group:
# limit the access of the generated GITHUB_TOKEN
permissions:
contents: read
jobs:
lint:
strategy:
matrix:
os: [windows-2022, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
# See https://github.com/actions/setup-go/pull/515
- uses: antontroshin/setup-go@bda02de8887c9946189f81e7e59512914aeb9ea4
with:
go-version-file: go.mod
cache: true
- name: install mage
run: go install github.com/magefile/mage
- run: |
mage -debug check
go vet ./...
update:
strategy:
matrix:
os: [ windows-2022, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
# See https://github.com/actions/setup-go/pull/515
- uses: antontroshin/setup-go@bda02de8887c9946189f81e7e59512914aeb9ea4
with:
go-version-file: go.mod
cache: true
- name: install mage
run: go install github.com/magefile/mage
- name: install protoc
run: |
#curl -sSfL -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protoc-3.19.4-linux-x86_64.zip
#mkdir -p $GITHUB_WORKSPACE/.protoc
#unzip -o protoc.zip -d $GITHUB_WORKSPACE/.protoc
#echo "$GITHUB_WORKSPACE/.protoc/bin" >> $GITHUB_PATH
$destination = "$GITHUB_WORKSPACE\protoc"
$protoUri = "https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protoc-3.19.4-win64.zip
if (-Not (Test-Path -Path $destination)) {
New-Item -ItemType Directory -Path $destination | Out-Null
}
Invoke-WebRequest -Uri $protoUri -OutFile protoc.zip
Expand-Archive -Path "protoc.zip" -DestinationPath $destination -Force
$protocBinPath = Join-Path $destination "bin"
if (-Not ($ENV:Path -contains $protocBinPath)) {
$ENV:Path += ";$protocBinPath"
}
mage -debug update
go test -v -race ./...
# - run: mage -debug update
# - run: go test -v -race ./...