From eacbfa68c11ab43988fef387079fc1c983847134 Mon Sep 17 00:00:00 2001 From: Benedikt Braunger Date: Tue, 23 Apr 2024 13:01:52 +0200 Subject: [PATCH 1/2] added CI --- .github/workflows/ci.yml | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..3034a83c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +name: Continuous Integration +on: + pull_request: + types: + - opened + - reopened + - synchronize + branches: + - master + push: + branches: + - master + tags: + - '**' + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build-run-test: + runs-on: ubuntu-latest + steps: + - name: Check out repository contents + uses: actions/checkout@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Build binary + run: | + docker build --tag lustre_exporter:binary -f docker/Dockerfile . + - name: Build rpm + run: | + docker build -t lustre_exporter:rpm -f docker/RPM-Dockerfile . + + - name: Extract binary + if: startsWith(github.ref, 'refs/tags/v') + run: | + docker run --rm -v $PWD:/cpy lustre_exporter:binary + sudo chown -R $USER:$GROUP build + - name: Upload binary + uses: actions/upload-artifact@v1.0.0 + if: startsWith(github.ref, 'refs/tags/v') + with: + name: lustre-exporter Binary ${{ github.ref_name }} + path: build/ + - name: Extract rpm + if: startsWith(github.ref, 'refs/tags/v') + run: | + sudo rm -rf build + docker run --rm -v $PWD:/rpm lustre_exporter:rpm + sudo chown -R $USER:$GROUP build + - name: Upload RPM + uses: actions/upload-artifact@v1.0.0 + if: startsWith(github.ref, 'refs/tags/v') + with: + name: lustre-exporter RPM ${{ github.ref_name }} + path: build/ From 37980cbb88d1357503e7226cbeafee3af865e499 Mon Sep 17 00:00:00 2001 From: Benedikt Braunger Date: Tue, 23 Apr 2024 14:48:49 +0200 Subject: [PATCH 2/2] README: added CI badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 982fdfec..67140d09 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ +[![Continuous Integration](https://github.com/GSI-HPC/lustre_exporter/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/GSI-HPC/lustre_exporter/actions/workflows/ci.yml) [Prometheus](https://prometheus.io/) exporter for [Lustre](https://www.lustre.org/) metrics.