From 765f0f9afd7462fada605379c4a7741bf1d49b2f Mon Sep 17 00:00:00 2001 From: Erwann Roussy Date: Tue, 30 May 2023 14:02:07 +0200 Subject: [PATCH] workflows/ansible-lint-weekly.yml: add file This file add a weekly ansible-lint on the main branch. It will ensure the main branch is always ok and will be used to display a badge on SEAPATH main page. Signed-off-by: Erwann Roussy --- .github/workflows/ansible-lint-weekly.yml | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/ansible-lint-weekly.yml diff --git a/.github/workflows/ansible-lint-weekly.yml b/.github/workflows/ansible-lint-weekly.yml new file mode 100644 index 000000000..8c458883e --- /dev/null +++ b/.github/workflows/ansible-lint-weekly.yml @@ -0,0 +1,33 @@ +# Copyright (C) 2023 Savoir-faire Linux, Inc. +# SPDX-License-Identifier: Apache-2.0 +# This file will execute ansible-lint on the main branch every saturday +# This ensure the main branch is always linted properly +# A badge is derived from this workflow + +name: Ansible Lint + +env: + WORK_DIR: /tmp/seapath_ci_${{ github.run_id }}_${{ github.run_attempt }}_${{ github.sha }} + +on: + schedule: + - cron: 0 22 * * SAT + +jobs: + ansible-lint: + runs-on: self-hosted + steps: + + - name: Initialize sources + run: mkdir ${{ env.WORK_DIR }}; cd ${{ env.WORK_DIR }}; + git clone -q --depth 1 -b main https://github.com/seapath/ci ci; + echo "Sources downloaded successfully"; + ci/ansible-lint.sh init; + + - name: Lint + run: cd ${{ env.WORK_DIR }}; + ci/ansible-lint.sh lint; + + - name: Clean + if: always() + run: rm -rf $WORK_DIR;