feat(tests): add new fuzz, resource leak, and network simulation tests; introduce benchmark and build-test workflows
All checks were successful
Go Build Test / Build (linux, arm) (pull_request) Successful in 41s
Go Build Test / Build (windows, amd64) (pull_request) Successful in 43s
Go Build Test / Build (freebsd, amd64) (pull_request) Successful in 45s
Go Benchmarks / Run Benchmarks (pull_request) Successful in 54s
Go Build Test / Build (js, wasm) (pull_request) Successful in 44s
Go Build Test / Build (linux, arm64) (pull_request) Successful in 48s
Go Build Test / Build (windows, arm64) (pull_request) Successful in 46s
Go Test Multi-Platform / Test (ubuntu-latest, arm64) (pull_request) Successful in 1m12s
Go Revive Lint / lint (pull_request) Successful in 1m8s
Run Gosec / tests (pull_request) Successful in 1m21s
Go Test Multi-Platform / Test (ubuntu-latest, amd64) (pull_request) Successful in 2m16s
Go Build Test / Build (darwin, amd64) (pull_request) Successful in 9m23s
Go Build Test / Build (freebsd, arm) (pull_request) Successful in 9m23s
Go Build Test / Build (linux, amd64) (pull_request) Successful in 9m26s
Go Build Test / Build (windows, arm) (pull_request) Successful in 9m26s
Go Build Test / Build (darwin, arm64) (pull_request) Successful in 9m24s
Go Build Test / Build (freebsd, arm64) (pull_request) Successful in 9m25s
Bearer / scan (pull_request) Successful in 10s
All checks were successful
Go Build Test / Build (linux, arm) (pull_request) Successful in 41s
Go Build Test / Build (windows, amd64) (pull_request) Successful in 43s
Go Build Test / Build (freebsd, amd64) (pull_request) Successful in 45s
Go Benchmarks / Run Benchmarks (pull_request) Successful in 54s
Go Build Test / Build (js, wasm) (pull_request) Successful in 44s
Go Build Test / Build (linux, arm64) (pull_request) Successful in 48s
Go Build Test / Build (windows, arm64) (pull_request) Successful in 46s
Go Test Multi-Platform / Test (ubuntu-latest, arm64) (pull_request) Successful in 1m12s
Go Revive Lint / lint (pull_request) Successful in 1m8s
Run Gosec / tests (pull_request) Successful in 1m21s
Go Test Multi-Platform / Test (ubuntu-latest, amd64) (pull_request) Successful in 2m16s
Go Build Test / Build (darwin, amd64) (pull_request) Successful in 9m23s
Go Build Test / Build (freebsd, arm) (pull_request) Successful in 9m23s
Go Build Test / Build (linux, amd64) (pull_request) Successful in 9m26s
Go Build Test / Build (windows, arm) (pull_request) Successful in 9m26s
Go Build Test / Build (darwin, arm64) (pull_request) Successful in 9m24s
Go Build Test / Build (freebsd, arm64) (pull_request) Successful in 9m25s
Bearer / scan (pull_request) Successful in 10s
This commit is contained in:
29
.gitea/workflows/benchmark.yml
Normal file
29
.gitea/workflows/benchmark.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Go Benchmarks
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main", "master" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "main", "master" ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
benchmark:
|
||||||
|
name: Run Benchmarks
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Source
|
||||||
|
uses: https://git.quad4.io/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: https://git.quad4.io/actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
|
||||||
|
with:
|
||||||
|
go-version: '1.25'
|
||||||
|
|
||||||
|
- name: Setup Task
|
||||||
|
uses: https://git.quad4.io/actions/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2
|
||||||
|
with:
|
||||||
|
version: '3.46.3'
|
||||||
|
|
||||||
|
- name: Run Benchmarks
|
||||||
|
run: task bench
|
||||||
|
|
||||||
55
.gitea/workflows/build-test.yml
Normal file
55
.gitea/workflows/build-test.yml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
name: Go Build Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build (${{ matrix.goos }}, ${{ matrix.goarch }})
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
goos: [linux, windows, darwin, freebsd]
|
||||||
|
goarch: [amd64, arm64, arm]
|
||||||
|
include:
|
||||||
|
- goos: js
|
||||||
|
goarch: wasm
|
||||||
|
exclude:
|
||||||
|
- goos: darwin
|
||||||
|
goarch: arm
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Source
|
||||||
|
uses: https://git.quad4.io/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: https://git.quad4.io/actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
|
||||||
|
with:
|
||||||
|
go-version: '1.25'
|
||||||
|
|
||||||
|
- name: Setup Task
|
||||||
|
uses: https://git.quad4.io/actions/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2
|
||||||
|
with:
|
||||||
|
version: '3.46.3'
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
env:
|
||||||
|
GOOS: ${{ matrix.goos }}
|
||||||
|
GOARCH: ${{ matrix.goarch }}
|
||||||
|
GOARM: ${{ matrix.goarch == 'arm' && '6' || '' }}
|
||||||
|
CGO_ENABLED: '0'
|
||||||
|
run: |
|
||||||
|
if [ "${{ matrix.goos }}" = "js" ] && [ "${{ matrix.goarch }}" = "wasm" ]; then
|
||||||
|
task build-wasm
|
||||||
|
else
|
||||||
|
task build
|
||||||
|
fi
|
||||||
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
name: Go Build Multi-Platform
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "main", "master" ]
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
pull_request:
|
|
||||||
branches: [ "main", "master" ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
goos: [linux, windows, darwin, freebsd]
|
|
||||||
goarch: [amd64, arm64, arm]
|
|
||||||
include:
|
|
||||||
- goos: js
|
|
||||||
goarch: wasm
|
|
||||||
exclude:
|
|
||||||
- goos: darwin
|
|
||||||
goarch: arm
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
outputs:
|
|
||||||
build_complete: ${{ steps.build_step.outcome == 'success' }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: https://git.quad4.io/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: https://git.quad4.io/actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
|
|
||||||
with:
|
|
||||||
go-version: '1.25'
|
|
||||||
|
|
||||||
- name: Setup Task
|
|
||||||
uses: https://git.quad4.io/actions/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2 # v1
|
|
||||||
with:
|
|
||||||
version: '3.46.3'
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
id: build_step
|
|
||||||
env:
|
|
||||||
GOOS: ${{ matrix.goos }}
|
|
||||||
GOARCH: ${{ matrix.goarch }}
|
|
||||||
GOARM: ${{ matrix.goarch == 'arm' && '6' || '' }}
|
|
||||||
CGO_ENABLED: '0'
|
|
||||||
run: |
|
|
||||||
output_name="reticulum-go-${GOOS}-${GOARCH}"
|
|
||||||
if [ "$GOOS" = "js" ] && [ "$GOARCH" = "wasm" ]; then
|
|
||||||
task build-wasm
|
|
||||||
output_name+=".wasm"
|
|
||||||
mv bin/reticulum-go.wasm "${output_name}"
|
|
||||||
else
|
|
||||||
task build
|
|
||||||
if [ "$GOOS" = "windows" ]; then
|
|
||||||
output_name+=".exe"
|
|
||||||
fi
|
|
||||||
mv bin/reticulum-go "${output_name}"
|
|
||||||
fi
|
|
||||||
echo "Built: ${output_name}"
|
|
||||||
|
|
||||||
- name: Calculate SHA256 Checksum
|
|
||||||
run: |
|
|
||||||
output_name="reticulum-go-${{ matrix.goos }}-${{ matrix.goarch }}"
|
|
||||||
if [ "${{ matrix.goos }}" = "windows" ]; then
|
|
||||||
output_name+=".exe"
|
|
||||||
elif [ "${{ matrix.goos }}" = "js" ] && [ "${{ matrix.goarch }}" = "wasm" ]; then
|
|
||||||
output_name+=".wasm"
|
|
||||||
fi
|
|
||||||
BINARY_PATH="${output_name}" task checksum
|
|
||||||
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: https://git.quad4.io/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3.2.1
|
|
||||||
with:
|
|
||||||
name: reticulum-go-${{ matrix.goos }}-${{ matrix.goarch }}
|
|
||||||
path: |
|
|
||||||
reticulum-go-${{ matrix.goos }}-${{ matrix.goarch }}*
|
|
||||||
|
|
||||||
release:
|
|
||||||
name: Create Release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: build
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Download All Build Artifacts
|
|
||||||
uses: https://git.quad4.io/actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
|
|
||||||
with:
|
|
||||||
path: ./release-assets
|
|
||||||
|
|
||||||
- name: List downloaded files (for debugging)
|
|
||||||
run: ls -R ./release-assets
|
|
||||||
|
|
||||||
- name: Create Gitea Release
|
|
||||||
uses: https://git.quad4.io/actions/gitea-release-action@4875285c0950474efb7ca2df55233c51333eeb74
|
|
||||||
with:
|
|
||||||
files: ./release-assets/*/*
|
|
||||||
@@ -65,41 +65,20 @@ jobs:
|
|||||||
if: matrix.os == 'ubuntu-latest' && matrix.goarch == 'amd64'
|
if: matrix.os == 'ubuntu-latest' && matrix.goarch == 'amd64'
|
||||||
run: task test-race
|
run: task test-race
|
||||||
|
|
||||||
|
- name: Run Resource Leak tests (Linux AMD64 only)
|
||||||
|
if: matrix.os == 'ubuntu-latest' && matrix.goarch == 'amd64'
|
||||||
|
run: task test-leaks
|
||||||
|
|
||||||
|
- name: Run Network Simulation tests (Linux AMD64 only)
|
||||||
|
if: matrix.os == 'ubuntu-latest' && matrix.goarch == 'amd64'
|
||||||
|
run: task test-network
|
||||||
|
|
||||||
|
- name: Run Fuzz tests (Linux AMD64 only)
|
||||||
|
if: matrix.os == 'ubuntu-latest' && matrix.goarch == 'amd64'
|
||||||
|
run: task test-fuzz
|
||||||
|
|
||||||
- name: Run WebAssembly tests (Linux AMD64 only)
|
- name: Run WebAssembly tests (Linux AMD64 only)
|
||||||
if: matrix.os == 'ubuntu-latest' && matrix.goarch == 'amd64'
|
if: matrix.os == 'ubuntu-latest' && matrix.goarch == 'amd64'
|
||||||
run: |
|
run: |
|
||||||
chmod +x misc/wasm/go_js_wasm_exec
|
chmod +x misc/wasm/go_js_wasm_exec
|
||||||
task test-wasm
|
task test-wasm
|
||||||
|
|
||||||
- name: Test build (ensure compilation works)
|
|
||||||
run: |
|
|
||||||
echo "Testing build for current platform (${{ matrix.os }}, ${{ matrix.goarch }})..."
|
|
||||||
task build
|
|
||||||
|
|
||||||
- name: Test WebAssembly build (Linux AMD64 only)
|
|
||||||
if: matrix.os == 'ubuntu-latest' && matrix.goarch == 'amd64'
|
|
||||||
run: task build-wasm
|
|
||||||
|
|
||||||
- name: Test binary execution
|
|
||||||
run: |
|
|
||||||
echo "Testing binary execution on (${{ matrix.os }}, ${{ matrix.goarch }})..."
|
|
||||||
timeout 5s ./bin/reticulum-go || echo "Binary started successfully (timeout expected)"
|
|
||||||
|
|
||||||
- name: Test cross-compilation (AMD64 runners only)
|
|
||||||
if: matrix.goarch == 'amd64'
|
|
||||||
run: |
|
|
||||||
echo "Testing ARM64 cross-compilation from AMD64..."
|
|
||||||
GOOS=linux GOARCH=arm64 task build
|
|
||||||
env:
|
|
||||||
GOOS: linux
|
|
||||||
GOARCH: arm64
|
|
||||||
|
|
||||||
- name: Test ARMv6 cross-compilation (AMD64 runners only)
|
|
||||||
if: matrix.goarch == 'amd64'
|
|
||||||
run: |
|
|
||||||
echo "Testing ARMv6 cross-compilation from AMD64..."
|
|
||||||
GOOS=linux GOARCH=arm GOARM=6 task build
|
|
||||||
env:
|
|
||||||
GOOS: linux
|
|
||||||
GOARCH: arm
|
|
||||||
GOARM: 6
|
|
||||||
|
|||||||
97
.gitea/workflows/publish.yml
Normal file
97
.gitea/workflows/publish.yml
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
name: Go Publish
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build (${{ matrix.goos }}, ${{ matrix.goarch }})
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
goos: [linux, windows, darwin, freebsd]
|
||||||
|
goarch: [amd64, arm64, arm]
|
||||||
|
include:
|
||||||
|
- goos: js
|
||||||
|
goarch: wasm
|
||||||
|
exclude:
|
||||||
|
- goos: darwin
|
||||||
|
goarch: arm
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Source
|
||||||
|
uses: https://git.quad4.io/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: https://git.quad4.io/actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
|
||||||
|
with:
|
||||||
|
go-version: '1.25'
|
||||||
|
|
||||||
|
- name: Setup Task
|
||||||
|
uses: https://git.quad4.io/actions/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2
|
||||||
|
with:
|
||||||
|
version: '3.46.3'
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
env:
|
||||||
|
GOOS: ${{ matrix.goos }}
|
||||||
|
GOARCH: ${{ matrix.goarch }}
|
||||||
|
GOARM: ${{ matrix.goarch == 'arm' && '6' || '' }}
|
||||||
|
CGO_ENABLED: '0'
|
||||||
|
run: |
|
||||||
|
output_name="reticulum-go-${{ matrix.goos }}-${{ matrix.goarch }}"
|
||||||
|
if [ "${{ matrix.goos }}" = "js" ] && [ "${{ matrix.goarch }}" = "wasm" ]; then
|
||||||
|
task build-wasm
|
||||||
|
output_name+=".wasm"
|
||||||
|
mv bin/reticulum-go.wasm "${output_name}"
|
||||||
|
else
|
||||||
|
task build
|
||||||
|
if [ "${{ matrix.goos }}" = "windows" ]; then
|
||||||
|
output_name+=".exe"
|
||||||
|
fi
|
||||||
|
mv bin/reticulum-go "${output_name}"
|
||||||
|
fi
|
||||||
|
echo "Built: ${output_name}"
|
||||||
|
|
||||||
|
- name: Calculate SHA256 Checksum
|
||||||
|
run: |
|
||||||
|
output_name="reticulum-go-${{ matrix.goos }}-${{ matrix.goarch }}"
|
||||||
|
if [ "${{ matrix.goos }}" = "windows" ]; then
|
||||||
|
output_name+=".exe"
|
||||||
|
elif [ "${{ matrix.goos }}" = "js" ] && [ "${{ matrix.goarch }}" = "wasm" ]; then
|
||||||
|
output_name+=".wasm"
|
||||||
|
fi
|
||||||
|
BINARY_PATH="${output_name}" task checksum
|
||||||
|
|
||||||
|
- name: Upload Artifact
|
||||||
|
uses: https://git.quad4.io/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5
|
||||||
|
with:
|
||||||
|
name: reticulum-go-${{ matrix.goos }}-${{ matrix.goarch }}
|
||||||
|
path: |
|
||||||
|
reticulum-go-${{ matrix.goos }}-${{ matrix.goarch }}*
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Create Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
steps:
|
||||||
|
- name: Download All Build Artifacts
|
||||||
|
uses: https://git.quad4.io/actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
|
||||||
|
with:
|
||||||
|
path: ./release-assets
|
||||||
|
|
||||||
|
- name: Create Gitea Release
|
||||||
|
uses: https://git.quad4.io/actions/gitea-release-action@4875285c0950474efb7ca2df55233c51333eeb74
|
||||||
|
with:
|
||||||
|
files: ./release-assets/*/*
|
||||||
|
|
||||||
15
Taskfile.yml
15
Taskfile.yml
@@ -141,6 +141,21 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- '{{.GOCMD}} test -race -v ./...'
|
- '{{.GOCMD}} test -race -v ./...'
|
||||||
|
|
||||||
|
test-fuzz:
|
||||||
|
desc: Run fuzz tests for a short duration
|
||||||
|
cmds:
|
||||||
|
- '{{.GOCMD}} test -fuzz=FuzzPacketUnpack -fuzztime=30s ./pkg/packet'
|
||||||
|
|
||||||
|
test-leaks:
|
||||||
|
desc: Run resource leak tests
|
||||||
|
cmds:
|
||||||
|
- '{{.GOCMD}} test -v ./pkg/transport -run TestTransportLeak'
|
||||||
|
|
||||||
|
test-network:
|
||||||
|
desc: Run network simulation tests
|
||||||
|
cmds:
|
||||||
|
- '{{.GOCMD}} test -v ./pkg/transport -run TestTransportNetworkSimulation'
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
desc: Generate test coverage report
|
desc: Generate test coverage report
|
||||||
cmds:
|
cmds:
|
||||||
|
|||||||
Reference in New Issue
Block a user