Skip to content

Commit

Permalink
ci: refactor actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaser committed Sep 16, 2023
1 parent 18fcb58 commit 69f4ef4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 48 deletions.
3 changes: 0 additions & 3 deletions .github/actions/molecule/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ inputs:
runs:
using: composite
steps:
- name: Checkout project
uses: actions/checkout@v4

- name: Install Poetry
shell: bash
run: pipx install poetry
Expand Down
33 changes: 7 additions & 26 deletions .github/workflows/ceph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,33 +48,11 @@ jobs:
- name: Checkout project
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Setup Python
uses: actions/setup-python@v4
- name: Run tests
uses: ./.github/actions/molecule
with:
cache: poetry

- name: Install dependencies
run: poetry install --no-interaction --with dev

# NOTE(mnaser): LVM commands take a long time if there are any existing
# loop devices created by "snapd", so we uninstall it.
- name: Uninstall "snapd"
run: sudo apt-get purge -y snapd

- name: Turn off swap
run: sudo swapoff -a

- name: Set environment variables
run: |
echo "HOST_IP=$(hostname -I | awk '{print $1}')" >> $GITHUB_ENV
- name: Run Molecule Converge
run: poetry run molecule converge -s ceph
env:
ATMOSPHERE_NETWORK_BACKEND: ${{ inputs.network_backend }}
scenario: ceph
network_backend: ${{ matrix.network_backend }}

# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
Expand All @@ -98,6 +76,9 @@ jobs:
group: ${{ github.ref }}-${{ matrix.network_backend }}
cancel-in-progress: true
steps:
- name: Checkout project
uses: actions/checkout@v4

- name: Run tests
uses: ./.github/actions/molecule
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/csi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:
- local-path-provisioner
- rbd
steps:
- name: Checkout project
uses: actions/checkout@v4

- name: Run tests
uses: ./.github/actions/molecule
with:
Expand Down
22 changes: 3 additions & 19 deletions .github/workflows/keycloak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,7 @@ jobs:
- name: Checkout project
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Setup Python
uses: actions/setup-python@v4
- name: Run tests
uses: ./.github/actions/molecule
with:
cache: poetry

- name: Install dependencies
run: poetry install --no-interaction --with dev

- name: Turn off swap
run: sudo swapoff -a

- name: Set environment variables
run: |
echo "HOST_IP=$(hostname -I | awk '{print $1}')" >> $GITHUB_ENV
- name: Run Molecule
run: poetry run molecule test -s keycloak
scenario: keycloak
3 changes: 3 additions & 0 deletions .github/workflows/magnum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
molecule:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4

- name: Run tests
uses: ./.github/actions/molecule
with:
Expand Down

0 comments on commit 69f4ef4

Please sign in to comment.