mirror of
https://github.com/jupp0r/prometheus-cpp.git
synced 2026-07-21 14:33:30 +00:00
ci: Run bazel from separate workflow
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
WORKSPACE=$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && /bin/pwd -P)
|
||||
|
||||
OS_ARG=${1:?}
|
||||
|
||||
bazel build //...
|
||||
|
||||
bazel test --test_output=all //core/... //pull/...
|
||||
bazel test --test_output=all //pull/tests/integration:scrape-test
|
||||
|
||||
#if [[ "${OS_ARG}" == "macOS"* ]]
|
||||
#then
|
||||
# bazel test --test_output=all //pull/tests/integration:lint-test
|
||||
#fi
|
||||
|
||||
bazel run -c opt //core/benchmarks
|
||||
@@ -1,5 +0,0 @@
|
||||
bazel build //... || EXIT /B 1
|
||||
|
||||
bazel test --test_output=all //core/... //pull/... || EXIT /B 1
|
||||
|
||||
bazel run -c opt //core/benchmarks || EXIT /B 1
|
||||
@@ -15,21 +15,11 @@ case "${OS_ARG}" in
|
||||
;;
|
||||
esac
|
||||
|
||||
curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
|
||||
source /etc/lsb-release
|
||||
echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
|
||||
packages+=(telegraf)
|
||||
|
||||
sudo apt-get remove -y --purge man-db # avoid time-consuming trigger
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y "${packages[@]}"
|
||||
sudo locale-gen de_DE.UTF-8 # used by SerializerTest
|
||||
;;
|
||||
|
||||
macOS*)
|
||||
packages=(prometheus telegraf)
|
||||
brew install "${packages[@]}"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "${BUILDSYSTEM_ARG}" in
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
name: Bazel CI
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Bazel on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-20.04, windows-2019]
|
||||
steps:
|
||||
- name: Checkout source
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Generate German locale on Ubuntu
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get remove -y --purge man-db # avoid time-consuming trigger
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y locales
|
||||
sudo locale-gen de_DE.UTF-8 # used by SerializerTest
|
||||
|
||||
- name: Install telegraf on Ubuntu
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
|
||||
source /etc/lsb-release
|
||||
echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y telegraf
|
||||
|
||||
- name: Install telegraf on macOS
|
||||
if: runner.os == 'macOS'
|
||||
run: brew install telegraf
|
||||
|
||||
- name: Build
|
||||
run: bazel build //...
|
||||
|
||||
- name: Test
|
||||
run: bazel test --test_output=all //core/... //pull/...
|
||||
|
||||
- name: Scraping Test
|
||||
if: runner.os != 'Windows'
|
||||
run: bazel test --test_output=all //pull/tests/integration:scrape-test
|
||||
|
||||
- name: Benchmark
|
||||
run: bazel run -c opt //core/benchmarks
|
||||
@@ -7,7 +7,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
buildsystem: [bazel, cmake]
|
||||
buildsystem: [cmake]
|
||||
os: [macOS-latest, ubuntu-16.04, windows-2016]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
bazel-*
|
||||
/bazel-*
|
||||
cmake-build-*/
|
||||
_*/
|
||||
.idea/
|
||||
|
||||
Reference in New Issue
Block a user