| 1 |
--- |
| 2 |
name: CI |
| 3 |
on: |
| 4 |
pull_request: |
| 5 |
push: |
| 6 |
branches: [main, master, 'release-*'] |
| 7 |
tags: ['v*'] |
| 8 |
|
| 9 |
permissions: |
| 10 |
contents: read |
| 11 |
|
| 12 |
jobs: |
| 13 |
test_go: |
| 14 |
name: Go tests |
| 15 |
runs-on: ubuntu-latest |
| 16 |
strategy: |
| 17 |
matrix: |
| 18 |
go-version: |
| 19 |
- 1.25.x |
| 20 |
- 1.26.x |
| 21 |
steps: |
| 22 |
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 |
| 23 |
with: |
| 24 |
persist-credentials: false |
| 25 |
- name: Install Go |
| 26 |
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c |
| 27 |
with: |
| 28 |
go-version: ${{ matrix.go-version }} |
| 29 |
cache: true |
| 30 |
cache-dependency-path: go.sum |
| 31 |
- name: Setup unprivileged UDP socket |
| 32 |
run: sudo sysctl -w net.ipv4.ping_group_range="0 2147483647" |
| 33 |
- run: make GO_ONLY=1 SKIP_GOLANGCI_LINT=1 |
| 34 |
- run: git diff --exit-code |
| 35 |
|
| 36 |
build: |
| 37 |
name: Build |
| 38 |
runs-on: ubuntu-latest |
| 39 |
strategy: |
| 40 |
matrix: |
| 41 |
thread: [ 0, 1, 2, 3] |
| 42 |
steps: |
| 43 |
- uses: prometheus/promci/build@d9d4f5688814f0b77bf003d07fb8c00507390634 |
| 44 |
with: |
| 45 |
parallelism: 4 |
| 46 |
thread: ${{ matrix.thread }} |
| 47 |
|
| 48 |
publish_release: |
| 49 |
name: Publish release artefacts |
| 50 |
runs-on: ubuntu-latest |
| 51 |
permissions: |
| 52 |
contents: write |
| 53 |
needs: [test_go, build] |
| 54 |
if: | |
| 55 |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) |
| 56 |
steps: |
| 57 |
- uses: prometheus/promci/publish_release@d9d4f5688814f0b77bf003d07fb8c00507390634 |
| 58 |
with: |
| 59 |
github_token: ${{ github.token }} |