Maj workflows CI/CD (#186) #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Continuous Integration" | |
on: | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
install_python_requirements: | |
name: Install Python requirements | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
- name: Cache Python dependencies | |
uses: actions/cache@v3 | |
id: python-dependencies | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ runner.os }}-python-dependencies-${{ hashFiles('**/requirements.txt') }} | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
lint_ansible_files: | |
name: Lint ansible files | |
runs-on: ubuntu-20.04 | |
needs: [install_python_requirements] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
- name: Cache Python dependencies | |
uses: actions/cache@v3 | |
id: python-dependencies | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ runner.os }}-python-dependencies-${{ hashFiles('**/requirements.txt') }} | |
- name: Check installed package | |
run: pip freeze | |
- name: Run ansible lint | |
run: ansible-lint --offline |