-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize workflows and Add tests (#4)
Reorganize workflows and Add tests
- Loading branch information
1 parent
937fa99
commit 0ff0018
Showing
3 changed files
with
112 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: release | ||
run-name: Release Packages | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
jobs: | ||
build-packages-workflow: | ||
uses: ./.github/workflows/build.yml | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: build-packages-workflow | ||
steps: | ||
- name: Download Prometheus Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: packages | ||
|
||
- name: Upload to release | ||
uses: pyTooling/Actions/releaser@r0 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
files: | | ||
*.deb | ||
*.rpm |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: test | ||
run-name: Test Packages | ||
on: push | ||
jobs: | ||
build-packages-workflow: | ||
uses: ./.github/workflows/build.yml | ||
|
||
deb-packages: | ||
runs-on: ubuntu-latest | ||
needs: build-packages-workflow | ||
container: | ||
image: debian:latest | ||
options: --cpus 1 | ||
steps: | ||
- name: Download Prometheus Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: packages | ||
|
||
- name: Install curl | ||
run: apt-get update; apt install -y curl | ||
|
||
- name: Install DEB packages | ||
run: dpkg -i *.deb | ||
|
||
- name: Start Prometheus | ||
run: | | ||
/usr/bin/prometheus --config.file=/etc/prometheus/prometheus.yml \ | ||
--storage.tsdb.path=/var/lib/prometheus/data \ | ||
--web.console.templates=/var/lib/prometheus/consoles \ | ||
--web.console.libraries=/var/lib/prometheus/console_libraries \ | ||
--web.enable-lifecycle &>/dev/null & | ||
- name: Check Prometheus | ||
run: curl http://localhost:9090/-/healthy | ||
|
||
- name: Start node_exporter | ||
run: /usr/bin/node_exporter &>/dev/null & | ||
|
||
- name: Check node_exporter | ||
run: curl -I http://localhost:9100/metrics | ||
|
||
- name: Start postgres_exporter | ||
run: /usr/bin/postgres_exporter &>/dev/null & | ||
|
||
- name: Check postgres_exporter | ||
run: curl -I http://localhost:9187/metrics | ||
|
||
rpm-packages: | ||
runs-on: ubuntu-latest | ||
needs: build-packages-workflow | ||
container: | ||
image: rockylinux:8 | ||
options: --cpus 1 | ||
steps: | ||
- name: Download Prometheus Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: packages | ||
|
||
- name: Install RPM packages | ||
run: dnf localinstall -y *.x86_64.rpm | ||
|
||
- name: Start Prometheus | ||
run: | | ||
/usr/bin/prometheus --config.file=/etc/prometheus/prometheus.yml \ | ||
--storage.tsdb.path=/var/lib/prometheus/data \ | ||
--web.console.templates=/var/lib/prometheus/consoles \ | ||
--web.console.libraries=/var/lib/prometheus/console_libraries \ | ||
--web.enable-lifecycle &>/dev/null & | ||
- name: Check Prometheus | ||
run: curl http://localhost:9090/-/healthy | ||
|
||
- name: Start node_exporter | ||
run: /usr/bin/node_exporter &>/dev/null & | ||
|
||
- name: Check node_exporter | ||
run: curl -I http://localhost:9100/metrics | ||
|
||
- name: Start postgres_exporter | ||
run: /usr/bin/postgres_exporter &>/dev/null & | ||
|
||
- name: Check postgres_exporter | ||
run: curl -I http://localhost:9187/metrics |