LoginSignup
0
1

More than 3 years have passed since last update.

GitHub ActionsでAnsible Lintを実行

Last updated at Posted at 2020-09-24

GitHub Actions上でPushとPullReqされたコードをCIにかけたかったので設定を行いました.

使用したパッケージは以下です.

ansible-lint · Actions · GitHub Marketplace

以下の設定ファイル(YAML)を .github/workflows/ansible-lint.yml に配置します・

ansible-lint.yml
name: AnsibleLint

on: [push]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python
      uses: actions/setup-python@v2
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install ansible==2.10 ansible-lint==4.3
    - name: Ansible Lint
      # working-directory: path/to/target_dir
      run: |
        ansible-lint --force-color

BadgeをREADMEへ追加してみます・

![](https://github.com/<ユーザ名>/<リポジトリ名>/workflows/AnsibleLint/badge.svg)

CIが正常終了するとREADMEに以下が表示されます.

image.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1