From 8266a073a0ab41e646ded6e40a502627bfa0e40c Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Mon, 26 Aug 2024 16:56:50 +0200 Subject: [PATCH] :construction_worker: Add Github Action --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++++ .github/workflows/galaxy.yml | 17 ++++++++++++++ .github/workflows/molecule.yml | 32 ++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/galaxy.yml create mode 100644 .github/workflows/molecule.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8da1ef8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +--- + +name: ci +'on': + pull_request: + push: + branches: + - master + +jobs: + + yaml-lint: + name: YAML Lint + runs-on: ubuntu-latest + steps: + + - name: Fetch code + uses: actions/checkout@v4 + + - 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 . + + ansible-lint: + name: Ansible Lint + runs-on: ubuntu-latest + + steps: + - name: Fetch code + uses: actions/checkout@v4 + + - name: Run ansible-lint + uses: ansible/ansible-lint@v24.7.0 diff --git a/.github/workflows/galaxy.yml b/.github/workflows/galaxy.yml new file mode 100644 index 0000000..4e88b7d --- /dev/null +++ b/.github/workflows/galaxy.yml @@ -0,0 +1,17 @@ +--- + +name: Deploy on Ansible Galaxy + +'on': + - push + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Fetch code + uses: actions/checkout@v4 + - name: galaxy + uses: robertdebock/galaxy-action@1.2.0 + with: + galaxy_api_key: ${{ secrets.galaxy_api_key }} diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml new file mode 100644 index 0000000..97fe279 --- /dev/null +++ b/.github/workflows/molecule.yml @@ -0,0 +1,32 @@ +--- +name: Molecule + +'on': + pull_request: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + scenario: + - debian12_master_slave + - debian12_upstream + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: "${{ github.repository }}" + + - name: Molecule + uses: gofrolist/molecule-action@v2 + with: + molecule_options: --base-config molecule/_shared/base.yml + molecule_args: --scenario-name ${{ matrix.scenario }} + env: + ANSIBLE_FORCE_COLOR: '1'