Skip to content

codec: only return error from Read if more data needs to be read #82

codec: only return error from Read if more data needs to be read

codec: only return error from Read if more data needs to be read #82

Workflow file for this run

name: Build and Test go-codec
on:
workflow_dispatch: {}
push:
branches: [ master ]
paths: [ '**.go', '.github/workflows/*' ]
pull_request:
branches: [ master ]
paths: [ '**.go', '.github/workflows/*' ]
jobs:
master_tests:
if: github.ref_name == 'master'
strategy:
fail-fast: false
matrix:
go: [ '1.24', '1.23', '1.22', '1.21' ]
arch: [ amd64 ]
os: [ ubuntu-latest ]
include:
- go: '1.23'
arch: '386'
os: ubuntu-latest
runs-on: ${{ matrix.os }}
env:
GO111MODULE: 'on'
LATEST_GO_STABLE_VERSION: '1.24'
GOARCH: ${{ matrix.arch }}
name: go ${{ matrix.go }} on ${{ matrix.arch }} at branch ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: false
- name: Run tests
if: matrix.go != env.LATEST_GO_STABLE_VERSION
shell: bash
run: |
cd codec
go mod edit -droprequire github.com/ugorji/go
t=( "" "codec.safe" "codec.notfastpath" "codec.notmono" )
for i in "${t[@]}"; do
go test "-tags=alltests codec.nobench ${i}" "-run=Suite"
done
- name: Run tests
if: matrix.go == env.LATEST_GO_STABLE_VERSION
shell: bash
run: |
cd codec
go mod edit -droprequire github.com/ugorji/go
t=( "" "codec.safe" "codec.notfastpath" "codec.safe codec.notfastpath" \
"codec.notmono" "codec.notmono codec.safe" \
"codec.notmono codec.notfastpath" "codec.notmono codec.safe codec.notfastpath" )
for i in "${t[@]}"; do
j="${i// /-}"
j="${j//codec./}"
go test "-tags=alltests codec.nobench ${i}" "-run=Suite" "-coverprofile=coverage.${{ matrix.go }}.${{ matrix.arch }}.${j}.txt"
done
- uses: codecov/codecov-action@v5
if: matrix.go == env.LATEST_GO_STABLE_VERSION
with:
directory: ./codec
# No need to go get, as github knows its working out of this folder.
#
# We test against the following go releases
# - latest production release (run all permutations - full matrix, with code cov)
# - prior production release (run i386)
# - last 3 prior releases (run 1 permutation per tag)
#
# Pre-release versions must use semver e.g. as of 20221220, it's '1.20.0-rc.1'
#
# Finally, we do a go mod edit -droprequire github.com/ugorji/go to circumvent the "missing go.sum entry" error
#
# --- SCRATCH ---
# coverage:
# if: ${{ always() }}
# needs: [ tests]
# steps:
# - uses: codecov/codecov-action@v3
# directory: ./codec
#
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0 # required for new-from-rev option in .golangci.yml