Skip to content

Update CONTRIBUTING.md #1630

Update CONTRIBUTING.md

Update CONTRIBUTING.md #1630

on:
push:
branches:
- main
- v1.0.x
- v1.1.x
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+'
pull_request:
branches:
- main
- v1.0.x
- v1.1.x
name: CI Tests
concurrency:
group: ci-build-tests-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- run: |
make check-codegen
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
args: --timeout 5m
only-new-issues: true
docker:
runs-on: ubuntu-latest
steps:
- name: Get Build Date
id: builddate
run: |
echo "builddate=$(date -u +%Y-%m-%dT%H:%M:%SZ)" | tee $GITHUB_OUTPUT
- uses: actions/checkout@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: build image
run: |
docker buildx build \
--label "org.opencontainers.image.revision=${{ github.sha }}" \
--label "org.opencontainers.image.source=https://github.com/${{ github.repository }}" \
--label "org.opencontainers.image.created=${{ steps.builddate.outputs.builddate }}" \
--platform linux/amd64 \
-f ./Dockerfile .
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: [1.26]
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install python dependencies
run: python -m pip install --upgrade pip setuptools wheel
- name: installing codespell
run: pip install codespell
- name: running codespell
run: codespell --skip="vendor,*.git,*.png,*.pdf,*.tiff,*.plist,*.pem,rangesim*.go,*.gz,go.mod,go.sum" --ignore-words="./testdata/ignore_words.txt"
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- uses: actions/checkout@v6
- name: Get dependencies
run: |
go mod download
- name: govulncheck
continue-on-error: true
run: go tool govulncheck ./...
- run: go mod vendor
- name: Run tests
run: make test
- name: Check coverage floor
run: |
COVERAGE=$(go tool cover -func=.coverprofile | tail -1 | awk '{print $3}' | tr -d '%')
echo "Total coverage: ${COVERAGE}%"
if (( $(echo "$COVERAGE < 50" | bc -l) )); then
echo "::error::Coverage ${COVERAGE}% is below 50% minimum"
exit 1
fi
- name: Run tests (with race detection enabled)
run: |
echo "::group::Race Detection Tests"
make data-race-test
echo "::endgroup::"
make data-race-test-inspect
- run: go build -o /dev/null ./cmd/trickster
- name: Send coverage
if: github.repository_owner == 'trickstercache' # Skip for forked repositories
uses: shogo82148/actions-goveralls@v1
# publishing to coveralls should not fail; and if it does, it should not block the CI process.
# Likely coveralls maintenance: https://status.coveralls.io/
# TODO: publish PR comment if coveralls publish fails
continue-on-error: true
with:
path-to-profile: .coverprofile
flag-name: unit-Go-${{ matrix.go }}
parallel: true
integration:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Start developer environment
run: make developer-start
- name: Show container status
if: always()
run: cd docs/developer/environment && docker compose ps && docker compose logs prometheus --tail=30
- name: Run integration tests (with coverage)
run: make integration-cover
- name: Run integration tests (with race detection enabled)
run: make -C integration data-race-test
- name: Send integration coverage
if: github.repository_owner == 'trickstercache'
uses: shogo82148/actions-goveralls@v1
continue-on-error: true
with:
path-to-profile: integration/.integration.coverprofile
flag-name: integration
parallel: true
finish:
needs:
- build
- integration
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
if: github.repository_owner == 'trickstercache' # Skip for forked repositories
continue-on-error: true
with:
parallel-finished: true