Skip to content

PMM-7 GitHub actions #7

PMM-7 GitHub actions

PMM-7 GitHub actions #7

Workflow file for this run

name: Node Exporter CI
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.19
- run: go mod download
- run: make test-e2e
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: node_exporter
path: node_exporter
# GitHub Actions does not support ARM yet
# test-arm:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - run: uname -a
# - run: make test-e2e
codespell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: sudo pip install codespell
- run: codespell --skip=".git,./vendor,ttar,go.mod,go.sum,*pem,./collector/fixtures" -I scripts/codespell_ignore.txt
test_mixins:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.19
- run: go install github.com/google/go-jsonnet/cmd/jsonnet@latest
- run: go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest
- run: go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
- run: make promtool
- run: make -C docs/node-mixin clean
- run: make -C docs/node-mixin jb_install
- run: make -C docs/node-mixin
- run: git diff --exit-code
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.19
- run: docker run --privileged linuxkit/binfmt:v0.8
- run: make promtool
- run: make promu
- run: promu crossbuild -v
- run: promu --config .promu-cgo.yml crossbuild -v
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: build
path: .build
test_docker:
needs: [test, build]
runs-on: ubuntu-latest
env:
DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.18-base
REPO_PATH: github.com/prometheus/node_exporter
steps:
- uses: actions/checkout@v2
- name: Download node_exporter artifact
uses: actions/download-artifact@v2
with:
name: node_exporter
- name: Download build artifact
uses: actions/download-artifact@v2
with:
name: build
- run: make docker
- run: docker images
- run: docker run --rm -t -v "$(pwd):/app" "${{ env.DOCKER_TEST_IMAGE_NAME }}" -i "${{ env.REPO_PATH }}" -T
- run: make test-docker