Skip to content

nit

nit #68

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.24'
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 }}
- shell: bash
run: cd codec; go get github.com/google/go-cmp/cmp
- 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
ii="${i// /-}"
ii="${ii//codec./}"
go test "-tags=alltests codec.nobench ${i}" "-run=Suite" "-coverprofile=coverage.${{ matrix.go }}.${{ matrix.arch }}.${ii}.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
# - 2 releases before that
# - and a beta/rc of development release (so github can just download an archive of it and use)
#
# Pre-release versions must use semver e.g. as of 20221220, it's '1.20.0-rc.1'
#
# We test amd64 on all releases, and i386 (32-bit) on last production release.
#
# Finally, we do a go mod edit -droprequire github.com/ugorji/go to circumvent the "missing go.sum entry" error.
# We put a requirements cycle with github.com/ugorji/go to allow folks requiring .../ugorji/go in 2019 to work ok.
# Now, everyone should have updated to a go-codec version >= 1.17 or preferably >= 1.2.0.
# Now is a good time to remove that requirements cycle.
#
#
# --- 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