Skip to content

Rerost/support only two go version #188

Rerost/support only two go version

Rerost/support only two go version #188

Workflow file for this run

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/')