add compression when posting metrics to dd #1027
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go Build and Test | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- 'docs/**' | |
- '.github/workflows/hugo.yml' | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- '.github/workflows/hugo.yml' | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag to run workflow for' | |
required: true | |
release: | |
types: [published] | |
jobs: | |
build-and-test: | |
name: Build and Test | |
runs-on: ${{ matrix.os }} | |
env: | |
PING_HOSTS_V4: 127.0.1.1,localhost | |
PING_HOSTS_V6: localhost | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- name: Check out code into the Go module directory | |
if: ${{ !contains(github.event_name, 'workflow_dispatch') }} | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Check out code into the Go module directory | |
if: ${{ contains(github.event_name, 'workflow_dispatch') }} | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.inputs.tag }} | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: go.mod | |
cache: true | |
id: go | |
- name: Set DISABLE_IPV6_TESTS on Windows OS | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: echo "DISABLE_IPV6_TESTS=yes" >> $env:GITHUB_ENV | |
- name: Get dependencies | |
run: go get -v -t -d ./... | |
- name: Build | |
run: go build -v . | |
- name: Set up ubuntu for testing | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: sudo sudo sysctl -w net.ipv4.ping_group_range="0 500000" | |
- name: Test | |
run: | | |
go install gotest.tools/gotestsum@latest | |
gotestsum --rerun-fails --packages=./... -- ${{ env.EXTRA_TEST_FLAGS }} -race -covermode=atomic | |
- name: Privileged ping tests. | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: | | |
go test github.com/cloudprober/cloudprober/probes/ping -c | |
sudo PING_HOSTS_V4=${{ env.PING_HOSTS_V4 }} PING_HOSTS_V6=${{ env.PING_HOSTS_V6 }} ./ping.test -test.v -test.run ^TestRunProbeRealICMP$ | |
build-binaries: | |
name: Build binaries | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
steps: | |
- name: Check out code into the Go module directory | |
if: ${{ !contains(github.event_name, 'workflow_dispatch') }} | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Check out code into the Go module directory | |
if: ${{ contains(github.event_name, 'workflow_dispatch') }} | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.inputs.tag }} | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: go.mod | |
cache: true | |
id: go | |
- run: make cloudprober-linux-{amd64,arm64,armv7} | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
- run: make cloudprober-macos-{amd64,arm64} cloudprober-windows-amd64 | |
if: ${{ matrix.os == 'macos-latest' }} | |
- name: Upload cloudprober dist | |
uses: actions/upload-artifact@v2 | |
with: | |
name: cloudprober-${{ matrix.os }}-dist | |
path: cloudprober-* | |
build-dist: | |
name: Build cloudprober release | |
needs: [build-and-test, build-binaries] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
if: ${{ !contains(github.event_name, 'workflow_dispatch') }} | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Check out code into the Go module directory | |
if: ${{ contains(github.event_name, 'workflow_dispatch') }} | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.inputs.tag }} | |
- name: Download ubuntu cloudprober binaries | |
uses: actions/download-artifact@v2 | |
with: | |
name: cloudprober-ubuntu-latest-dist | |
- name: Download macos cloudprober binaries | |
uses: actions/download-artifact@v2 | |
with: | |
name: cloudprober-macos-latest-dist | |
- run: make dist | |
- name: Upload cloudprober release | |
uses: actions/upload-artifact@v2 | |
with: | |
name: cloudprober-release-binaries | |
path: cloudprober-*.zip | |
build_and_push_docker_multiarch: | |
name: Build and push multiarch docker image | |
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags') | |
needs: [build-and-test, build-binaries] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
if: ${{ !contains(github.event_name, 'workflow_dispatch') }} | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Check out code into the Go module directory | |
if: ${{ contains(github.event_name, 'workflow_dispatch') }} | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.inputs.tag }} | |
- name: Download cloudprober binary | |
uses: actions/download-artifact@v2 | |
with: | |
name: cloudprober-ubuntu-latest-dist | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.docker_login }} | |
password: ${{ secrets.docker_pass }} | |
- name: Login to GHCR | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- run: | | |
cp cloudprober-linux-amd64 cloudprober | |
ls -R cloudprober* | |
chmod a+rx cloudprober cloudprober-* | |
- name: Build and push release Docker Image (main-dockerhub) | |
run: make docker_multiarch | |
- name: Build and push release Docker Image (main-ghcr) | |
run: make docker_multiarch DOCKER_IMAGE=ghcr.io/cloudprober/cloudprober | |
- name: Build and push release Docker Image (contrib) | |
run: make -C contrib docker_multiarch | |
- name: Build and push release Docker Image (contrib-ghcr) | |
run: make docker_multiarch DOCKER_IMAGE=ghcr.io/cloudprober/cloudprober |