robot-nightly #3339
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
name: centreon collect nightly robot | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
robot-test: | |
runs-on: [self-hosted, collect] | |
strategy: | |
matrix: | |
# branch: [develop, master] | |
include: | |
- image: centreon-collect-centos7 | |
distrib: el7 | |
folder_report: tests/ | |
- image: centreon-collect-alma8 | |
distrib: el8 | |
folder_report: tests/ | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- id: version | |
run: | | |
IMG_VERSION=$(md5sum conanfile.txt | awk '{print substr($1, 0, 8)}') | |
echo "imgversion=$IMG_VERSION" >> $GITHUB_ENV | |
VERSION=$(awk '$1 ~ "COLLECT_MAJOR" {maj=substr($2, 1, length($2)-1)} $1 ~ "COLLECT_MINOR" {min=substr($2, 1, length($2)-1) ; print maj "." min}' CMakeLists.txt) | |
PATCH=$(awk '$1 ~ "COLLECT_PATCH" {print substr($2, 1, length($2) - 1)}' CMakeLists.txt) | |
echo "version=$VERSION" >> $GITHUB_ENV | |
echo "patch=$PATCH" >> $GITHUB_ENV | |
if [[ -z "$GITHUB_HEAD_REF" ]] ; then | |
BRANCHNAME="$GITHUB_REF_NAME" | |
else | |
BRANCHNAME="$GITHUB_HEAD_REF" | |
fi | |
case "$BRANCHNAME" in | |
master | [2-9][0-9].[0-9][0-9].x | release* | hotfix*) | |
echo "release=$GITHUB_RUN_ATTEMPT" >> $GITHUB_ENV | |
;; | |
*) | |
echo "release=`date +%s`.`echo ${{ github.sha }} | cut -c -7`" >> $GITHUB_OUTPUT | |
echo "release=`date +%s`.`echo ${{ github.sha }} | cut -c -7`" >> $GITHUB_ENV | |
;; | |
esac | |
shell: bash | |
- name: Install RPM packages | |
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 | |
with: | |
path: ./*.rpm | |
key: cache-${{ github.sha }}-rpmbuild-centreon-collect-el7-${{ github.head_ref || github.ref_name }} | |
restore-keys: cache-${{ github.sha }}-rpmbuild-centreon-collect-el7-${{ github.head_ref || github.ref_name }} | |
- name: Login to Registry | |
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 | |
with: | |
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }} | |
username: ${{ secrets.DOCKER_REGISTRY_ID }} | |
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }} | |
- name: Tests robot (Centos7, Alma8) | |
uses: ./.github/actions/runner-docker | |
with: | |
registry_url: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }} | |
script_name: /src/ci/scripts/collect-test-robot | |
image_name: ${{ matrix.image }} | |
image_version: ${{ env.imgversion }} | |
- name: Send report to commit | |
uses: joonvena/robotframework-reporter-action@1f1268f26d5eb74e298acec6f271962244524c1f # v2.1 | |
with: | |
gh_access_token: ${{ secrets.GITHUB_TOKEN }} | |
report_path: ${{ matrix.folder_report }} |