Skip to content

Update to minimum go version 1.22 #154

Update to minimum go version 1.22

Update to minimum go version 1.22 #154

Workflow file for this run

name: Go
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
deps:
strategy:
matrix:
version: ['1.22.0']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: ./.github/actions/setup-go
with:
go-version: ${{ matrix.version }}
bench:
needs: ["deps"]
strategy:
matrix:
version: ['1.22.0']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: ./.github/actions/setup-go
with:
go-version: ${{ matrix.version }}
- name: Bench
run: go test -v -run ^$ -bench . ./...
test:
permissions:
contents: read
issues: write
pull-requests: write
needs: ["deps"]
strategy:
matrix:
version: ['1.22.0']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: ./.github/actions/setup-go
with:
go-version: ${{ matrix.version }}
- name: Main branch coverage
uses: actions/cache@v3
if: matrix.version == '1.22.0'
with:
path: |
main.lcov
key: ${{ runner.os }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-refs/heads/main-
- name: Test
run: go test -v -coverprofile coverage.out -race ./...
- uses: jandelgado/[email protected]
if: matrix.version == '1.22.0'
- name: Store main branch lcov
if: github.ref == 'refs/heads/main' && matrix.version == '1.22.0'
run: cp coverage.lcov main.lcov
- name: Code Coverage Report
uses: osmind-development-org/[email protected]
if: matrix.version == '1.22.0' && github.event_name == 'pull_request'
with:
lcov-file: ./coverage.lcov
lcov-base: ./main.lcov
delete-old-comments: true
github-token: ${{ secrets.GITHUB_TOKEN }}
lint:
permissions:
contents: read
issues: write
pull-requests: write
needs: ["deps"]
strategy:
matrix:
version: ['1.22.0']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: ./.github/actions/setup-go
with:
go-version: ${{ matrix.version }}
- name: Static check
if: github.event_name == 'pull_request'
uses: dominikh/[email protected]
with:
version: "2023.1.7"
install-go: false
cache-key: ${{ matrix.go }}