Split test and release into 2 parts.

This commit is contained in:
Robert de Bock 2019-12-30 19:46:03 +01:00
parent 22c53ecdf2
commit 23108cce72
3 changed files with 38 additions and 11 deletions

View File

@ -175,5 +175,7 @@
- source: CONTRIBUTING.md
- source: ansible.yml
dest: .github/workflows/ansible.yml
- source: galaxy.yml
dest: .github/workflows/galaxy.yml
loop_control:
label: "{{ item.source }}"

View File

@ -1,13 +1,29 @@
---
{{ ansible_managed | comment }}
name: GitHub Action
name: Ansible Molecule
on:
- push
push:
tags_ignore:
- '*'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: molecule
uses: robertdebock/molecule-action@1.1.1
with:
image: {% raw %}${{ matrix.image }}{% endraw %}
entrypoint: /usr/local/bin/molecule
args: lint
test:
needs:
- lint
runs-on: ubuntu-latest
strategy:
matrix:
@ -105,12 +121,3 @@ jobs:
options: "--parallel all"
{% endif %}
{% endif %}
release:
needs:
- test
runs-on: ubuntu-latest
steps:
- name: galaxy
uses: robertdebock/galaxy-action@1.0.0
with:
galaxy_api_key: {% raw %}${{ secrets.galaxy_api_key }}{% endraw %}

18
templates/galaxy.yml.j2 Normal file
View File

@ -0,0 +1,18 @@
---
{{ ansible_managed | comment }}
name: Release to Ansible Galaxy
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: galaxy
uses: robertdebock/galaxy-action@1.0.0
with:
galaxy_api_key: {% raw %}${{ secrets.galaxy_api_key }}{% endraw %}