Skip to content

Commit

Permalink
🔧 ci: Update workflow for PRs and latest Ubuntu versions (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
esolitos authored Dec 2, 2024
2 parents d71cbd4 + 6a0084e commit 5f6fb46
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Ansible CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

workflow_dispatch:

Expand All @@ -11,28 +13,36 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
distro: [ubuntu1804, ubuntu2004, ubuntu2104, debian9, debian10]
distro: [
ubuntu2004, ubuntu2204, ubuntu2404,
debian10, debian11, debian12,
rockylinux9,
]
steps:
-
uses: actions/checkout@v4
-
name: Download test shim.
run: |
wget -O ${PWD}/tests/test-ansible-role.sh https://raw.githubusercontent.com/esolitos/gists/master/shell/test-ansible-role.sh
chmod +x ${PWD}/tests/test-ansible-role.sh
run: |
wget -O "${PWD}/tests/test-ansible-role.sh" https://raw.githubusercontent.com/esolitos/gists/master/shell/test-ansible-role.sh
chmod +x "${PWD}/tests/test-ansible-role.sh"
-
name: Run test
run: ${PWD}/tests/test-ansible-role.sh -d ${{ matrix.distro }}
run: ${PWD}/tests/test-ansible-role.sh -d ${{ matrix.distro }}

publish:
# Run this job only if the push event is triggered on the default branch
if: github.event_name == 'push' && github.ref == ${{ github.event.repository.default_branch }}
needs:
- test
runs-on: ubuntu-latest
env:
ansible-galaxy-key: ${{ secrets.ANSIBLE_GALAXY_KEY }}
steps:
-
uses: actions/checkout@v2
uses: actions/checkout@v4
-
name: Publish Ansible role to Galaxy
uses: robertdebock/galaxy-action@1.1.1
uses: robertdebock/galaxy-action@1.2.1
with:
galaxy_api_key: ${{ env.ansible-galaxy-key }}

0 comments on commit 5f6fb46

Please sign in to comment.