Merge branch 'prometheus:master' into master #1
This file contains hidden or 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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [master, 'release-*'] | |
| tags: ['v*'] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test_go: | |
| name: Go tests | |
| runs-on: ubuntu-latest | |
| container: | |
| # Whenever the Go version is updated here, .promu.yml and .promu-cgo.yml | |
| # should also be updated. | |
| image: quay.io/prometheus/golang-builder:1.26-base | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - run: go mod download | |
| - run: make | |
| test_go_arm: | |
| name: Go ARM tests | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version: 1.26.x | |
| - run: uname -a | |
| - run: make test-e2e | |
| test_mixins: | |
| name: Mixins tests | |
| runs-on: ubuntu-latest | |
| container: | |
| # Whenever the Go version is updated here, .promu.yml and .promu-cgo.yml | |
| # should also be updated. | |
| image: quay.io/prometheus/golang-builder:1.26-base | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - 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: | |
| name: Build node_exporter for all architectures | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| thread: [ 0, 1, 2 ] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: prometheus/promci-setup@5af30ba8c199a91d6c04ebdc3c48e630e355f62d # v0.1.0 | |
| - name: Crossbuild | |
| run: ~/go/bin/promu crossbuild -v --parallelism 3 --parallelism-thread ${{ matrix.thread }} | |
| - name: CGO crossbuild | |
| run: ~/go/bin/promu --config .promu-cgo.yml crossbuild -v --parallelism 3 --parallelism-thread ${{ matrix.thread }} | |
| - name: Codesign darwin binaries | |
| run: | | |
| if [[ -f "$(pwd)/.build/darwin-arm64/node_exporter" ]]; then | |
| ~/go/bin/promu codesign "$(pwd)/.build/darwin-arm64/node_exporter" | |
| fi | |
| if [[ -f "$(pwd)/.build/darwin-amd64/node_exporter" ]]; then | |
| ~/go/bin/promu codesign "$(pwd)/.build/darwin-amd64/node_exporter" | |
| fi | |
| - uses: prometheus/promci-artifacts/save@f9a587dbc0b2c78a0c54f8ad1cde71ea29a4b76f # v0.1.0 | |
| with: | |
| directory: .build | |
| test_docker: | |
| name: Test docker image | |
| runs-on: ubuntu-latest | |
| needs: [test_go, build] | |
| env: | |
| DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.26-base | |
| REPO_PATH: github.com/prometheus/node_exporter | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: prometheus/promci-artifacts/restore@f9a587dbc0b2c78a0c54f8ad1cde71ea29a4b76f # v0.1.0 | |
| - name: Build docker image | |
| run: | | |
| if [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
| make docker DOCKER_IMAGE_TAG=${{ github.ref_name }} | |
| else | |
| make docker | |
| fi | |
| - run: docker images | |
| - run: docker run --rm -t -v "$(pwd):/app" "${DOCKER_TEST_IMAGE_NAME}" -i "${REPO_PATH}" -T | |
| - name: Test docker image | |
| run: | | |
| if [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
| make test-docker DOCKER_IMAGE_TAG=${{ github.ref_name }} | |
| else | |
| make test-docker | |
| fi | |
| publish_main: | |
| name: Publish main branch artifacts | |
| runs-on: ubuntu-latest | |
| needs: [test_go, test_go_arm, build] | |
| if: github.event_name == 'push' && github.event.ref == 'refs/heads/master' | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: prometheus/promci/publish_main@769ee18070cd21cfc2a24fa912349fd3e48dee58 # v0.6.0 | |
| with: | |
| docker_hub_login: ${{ secrets.docker_hub_login }} | |
| docker_hub_password: ${{ secrets.docker_hub_password }} | |
| quay_io_login: ${{ secrets.quay_io_login }} | |
| quay_io_password: ${{ secrets.quay_io_password }} | |
| publish_release: | |
| name: Publish release artifacts | |
| runs-on: ubuntu-latest | |
| needs: [test_go, test_go_arm, build] | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: prometheus/promci/publish_release@769ee18070cd21cfc2a24fa912349fd3e48dee58 # v0.6.0 | |
| with: | |
| docker_hub_login: ${{ secrets.docker_hub_login }} | |
| docker_hub_password: ${{ secrets.docker_hub_password }} | |
| quay_io_login: ${{ secrets.quay_io_login }} | |
| quay_io_password: ${{ secrets.quay_io_password }} | |
| github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }} |