From ec7a17cdd2a7151361ccda0097d1737343d02774 Mon Sep 17 00:00:00 2001 From: Glauber Batista Date: Thu, 30 Nov 2023 13:44:03 -0300 Subject: [PATCH] feat: add ci and release workflows --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8683e70 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +--- +name: CI +on: + push: + branches: + - master + pull_request: + +jobs: + molecule: + name: Molecule + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python 3 + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install pipenv + run: pip3 install pipenv + + - name: Create pipenv + run: pipenv install + + - name: Run Molecule tests + run: pipenv run molecule test + env: + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7735032 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +--- +name: Release +on: + push: + tags: + - '*' + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python 3 + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install Ansible + run: pip3 install ansible-core + + - name: Trigger a new import on Galaxy. + run: >- + ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} + $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)