Files
go-i2p/.github/workflows/tests.yml
2024-11-28 20:18:03 -05:00

80 lines
2.0 KiB
YAML

name: Go Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false # Ensure all matrix jobs run even if some fail
matrix:
test_target:
- "test-string-all"
- "test-mapping-all"
- "test-crypto-aes-all"
- "test-crypto-dsa-all"
- "test-crypto-ed25519-all"
- "test-crypto-elg-all"
- "test-crypto-hmac-all"
- "test-i2np-header-all"
- "test-i2np-build-request-all"
- "test-key-cert-all"
- "test-keys-cert-all"
- "test-lease-set-all"
- "test-noise-transport-all"
- "test-router-address-all"
- "test-router-info-all"
- "test-su3-all"
- "test-tunnel-all"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21' # Adjust this version as needed
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install gofumpt
run: go install mvdan.cc/gofumpt@latest
- name: Go mod tidy
run: go mod tidy
- name: Run ${{ matrix.test_target }}
run: make ${{ matrix.test_target }}
env:
GO: go
DEBUG_I2P: debug
CGO_ENABLED: 0
- name: Upload Test Logs (Optional)
if: always()
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.test_target }}-logs
path: ./test-logs/${{ matrix.test_target }}.log # Adjust this path as needed
aggregate_results:
needs: test
runs-on: ubuntu-latest
steps:
- name: Aggregate Test Results
run: echo "All tests have been executed. Review individual job logs for details."