From f5fb69c475f1343202897fb840e371ba51991831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Moser?= Date: Mon, 5 Jul 2021 17:48:33 +0200 Subject: [PATCH] add ci (#2) --- .github/workflows/publish.yml | 30 +++++++++++++++++++++++++++++ .github/workflows/sanity.yml | 36 +++++++++++++++++++++++++++++++++++ tests/.keep | 0 3 files changed, 66 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/sanity.yml create mode 100644 tests/.keep diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..f582ec0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,30 @@ +name: Upload release to Galaxy + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ansible_collections/ngine_io/hashi + steps: + - uses: actions/checkout@v2 + with: + path: ansible_collections/ngine_io/hashi + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ansible + - name: Build and publish + env: + ANSIBLE_GALAXY_API_KEY: ${{ secrets.ANSIBLE_GALAXY_API_KEY }} + run: | + ansible-galaxy collection build . + ansible-galaxy collection publish *.tar.gz --api-key $ANSIBLE_GALAXY_API_KEY diff --git a/.github/workflows/sanity.yml b/.github/workflows/sanity.yml new file mode 100644 index 0000000..5b29a64 --- /dev/null +++ b/.github/workflows/sanity.yml @@ -0,0 +1,36 @@ +name: Sanity +on: + schedule: + - cron: "5 12 * * *" + pull_request: + +jobs: + sanity: + name: Sanity (${{ matrix.ansible }}) + defaults: + run: + working-directory: ansible_collections/ngine_io/hashi + strategy: + matrix: + ansible: + - stable-2.11 + - stable-2.10 + - stable-2.9 + - devel + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + with: + path: ansible_collections/ngine_io/hashi + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install ansible-base (${{ matrix.ansible }}) + run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check + + - name: Run sanity tests + run: ansible-test sanity --docker -v --color diff --git a/tests/.keep b/tests/.keep new file mode 100644 index 0000000..e69de29