Skip to content

Commit

Permalink
Update ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMwashuma committed Sep 10, 2024
1 parent c144c4b commit 57ba932
Showing 1 changed file with 58 additions and 29 deletions.
87 changes: 58 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,59 @@
---
name: Molecule Test

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6]

steps:
- uses: actions/checkout@v1
with:
path: "${{ github.repository }}"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt install docker
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with molecule
run: |
molecule test
name: Molecule Test
on:
push:
pull_request:
schedule:
- cron: "5 12 * * 1"

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v3
with:
path: "${{ github.repository }}"

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'

- name: Install dependencies
run: pip3 install yamllint

- name: Lint code
working-directory: onaio/ansible-express
run: yamllint .
molecule:
name: Molecule
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
distro:
- ubuntu2204
- ubuntu2004
steps:
- name: Checkout codebase
uses: actions/checkout@v3
with:
path: "${{ github.repository }}"

- name: Set up Python 3.
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install test dependencies.
run: pip3 install ansible molecule-plugins[docker] docker pytest-testinfra

- name: Run Molecule tests.
working-directory: onaio/ansible-express
run: molecule test
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
MOLECULE_DISTRO: ${{ matrix.distro }}

0 comments on commit 57ba932

Please sign in to comment.