Trigger COPR from GHA #467
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: main CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
# add a cron job to run every month -- this project is not very active, at least ensure there's a valid CI build every month | |
# this is also useful to check if something breaks e.g. due to infrastructure changes (e.g. Ubuntu OS) | |
schedule: | |
- cron: '0 0 1 * *' | |
jobs: | |
build_test_with_prometheus_support: | |
runs-on: ubuntu-latest | |
steps: | |
# install deps | |
- uses: actions/checkout@v4 | |
- name: install debian-packaged dependencies | |
run: sudo apt install -y libgtest-dev libbenchmark-dev libfmt-dev tidy git python3 python3-dateutil pipx | |
- name: install pypi-packaged dependencies | |
run: | | |
sudo pip3 install pytest 'black==22.8.0' | |
sudo pipx ensurepath | |
sudo pipx install 'conan==2.14.0' | |
# NOTE: since we later run "make" using the normal "builder" user, we must use Conan using that same user (so avoid the "sudo"!!) | |
- name: install Conan-packaged dependencies | |
run: | | |
conan profile detect --force | |
conan install conanfile.txt --build=missing | |
# build & test | |
- name: check Python formatting | |
run: make format_check | |
- name: build cmonitor (with Prometheus support) | |
run: make PROMETHEUS_SUPPORT=1 | |
- name: run unit tests | |
run: make test PROMETHEUS_SUPPORT=1 | |
# save binary | |
- name: save built binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cmonitor, Linux x86_64, Prometheus Support | |
path: collector/bin/glibc/cmonitor_collector | |
if-no-files-found: error | |
build_test_without_prometheus_support: | |
runs-on: ubuntu-latest | |
steps: | |
# install deps | |
- uses: actions/checkout@v4 | |
- name: install debian-packaged dependencies | |
run: sudo apt install -y libgtest-dev libbenchmark-dev libfmt-dev tidy git python3 python3-dateutil python3-pip | |
- name: install pypi-packaged dependencies | |
run: sudo pip3 install pytest black | |
# build & test | |
- name: build cmonitor (with Prometheus support) | |
run: make PROMETHEUS_SUPPORT=0 | |
- name: run unit tests | |
run: make test PROMETHEUS_SUPPORT=0 | |
# save binary | |
- name: save built binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cmonitor, Linux x86_64, No Prometheus Support | |
path: collector/bin/glibc/cmonitor_collector | |
if-no-files-found: error | |
# this step is useful to check that the Dockerfile still works fine | |
alpine_docker_image_creation: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Docker image (no push) | |
uses: mr-smithers-excellent/docker-build-push@v6 | |
with: | |
# options related to BUILDing the docker image: | |
dockerfile: ./collector/docker/Dockerfile | |
multiPlatform: false | |
platform: linux/amd64 | |
image: cmonitor | |
# options related to PUSHing the docker image: | |
registry: docker.io | |
pushImage: false # for now official docker images are published on DockerHub manually on new tags... |