Skip to content

feat(gslice): Add MapIndexed (#27) #148

feat(gslice): Add MapIndexed (#27)

feat(gslice): Add MapIndexed (#27) #148

Workflow file for this run

name: Go Test and Benchmark
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.18.x, 1.19.x, 1.20.x, 1.21.x, 1.22.x, 1.23.x, 1.24.x]
steps:
- uses: actions/checkout@v4
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: go mod tidy
- name: Run unit tests
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Run benchmarks
if: matrix.go-version == '1.24.x'
run: go test -v -bench=. -benchmem ./...
- name: Upload coverage report
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: false
files: coverage.txt
flags: go-${{ matrix.go-version }},unittests
name: go-${{ matrix.go-version }}
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true