aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorColin Wilk <colin.wilk@tum.de>2023-05-29 14:51:35 +0200
committerColin Wilk <colin.wilk@tum.de>2023-05-29 15:08:55 +0200
commite2e9628ab8f9fff3ef479a2acacc20e26f830194 (patch)
treeae830e321abfbcfb75b818b3186bb32eaa73f307
parent3e545357833872a6c344169000c035802a43f97a (diff)
downloadansible-role-prometheus-target-e2e9628ab8f9fff3ef479a2acacc20e26f830194.tar.gz
ansible-role-prometheus-target-e2e9628ab8f9fff3ef479a2acacc20e26f830194.zip
Add github actions pipeline
Signed-off-by: Colin Wilk <colin.wilk@tum.de>
-rw-r--r--.github/workflows/ci.yml80
1 files changed, 80 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..d42b8b2
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,80 @@
+---
+name: CI
+
+'on':
+ push:
+ branches:
+ - master
+ - dev
+ schedule:
+ - cron: 0 4 * * 5
+
+defaults:
+ run:
+ working-directory: kliwniloc.prometheus_target
+
+jobs:
+ pre-commit:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-python@v3
+ - uses: pre-commit/action@v3.0.0
+
+
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out the codebase.
+ uses: actions/checkout@v2
+ with:
+ path: kliwniloc.prometheus_target
+
+ - name: Set up Python 3.
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.x
+
+ - name: Install test dependencies.
+ run: pip3 install yamllint
+
+ - name: Lint code.
+ run: |
+ yamllint .
+
+
+ molecule:
+ name: Molecule
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ distro:
+ - debian:10
+ - debian:11
+
+ - ubuntu:18.04
+ - ubuntu:20.04
+ - ubuntu:22.04
+ - ubuntu:23.04
+
+ steps:
+ - name: Check out the codebase.
+ uses: actions/checkout@v2
+ with:
+ path: kliwniloc.prometheus_target
+
+ - name: Set up Python 3.
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.x
+
+ - name: Install test dependencies.
+ run: pip3 install ansible molecule molecule-plugins[docker] docker pytest testinfra
+
+ - name: Run Molecule tests.
+ run: molecule test
+ env:
+ PY_COLORS: '1'
+ ANSIBLE_FORCE_COLOR: '1'
+ MOLECULE_DISTRO: ${{ matrix.distro }}