Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add lints for ansible and helm #34

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:

jobs:
chart-directories:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: kanga333/json-array-builder@main
id: array
with:
cmd: find charts/placeos/charts -mindepth 1 -type d -not -name tests -not -name templates
outputs:
directories: ${{ steps.array.outputs.build }}

kube-lint:
needs: chart-directories
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
directory: ${{ fromJson(needs.chart-directories.outputs.directories) }}
steps:
- uses: actions/checkout@v2

# This prepares directory where github/codeql-action/upload-sarif@v1 looks up report files by default.
- name: Create ../results directory for SARIF report files
shell: bash
run: mkdir -p ../results

- name: Scan yaml files with kube-linter
continue-on-error: true
uses: stackrox/kube-linter-action@v1.0.4
id: kube-linter-action-scan
with:
directory: ${{ matrix.directory }}
format: sarif
output-file: ../results/kube-linter.sarif

- name: Upload SARIF report files to GitHub
uses: github/codeql-action/upload-sarif@v1

# Ensure the workflow eventually fails if files did not pass kube-linter checks.
- name: Verify kube-linter-action succeeded
shell: bash
run: |
echo "If this step fails, kube-linter found issues. Check the output of the scan step above."
[[ "${{ steps.kube-linter-action-scan.outcome }}" == "success" ]]

ansible-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Lint Ansible Playbook
uses: ansible/ansible-lint-action@master
with:
targets: ansible
override-deps: |
rich>=10.0.0,<11.0.0