73 lines (57 loc) · 1.49 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: molecule
on:
pull_request:
branches:
- "master"
paths-ignore:
- ".github/**"
- "**.md"
concurrency:
group: "ci-${{ github.head_ref }}"
cancel-in-progress: true
env:
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1
OBJC_DISABLE_INITIALIZE_FORK_SAFETY: YES
jobs:
lint:
name: "Lint with reviewdog"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Setup Python"
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: "Run yamllint"
uses: reviewdog/action-yamllint@v1
with:
fail_on_error: true
- name: "Run ansible-lint"
uses: reviewdog/action-ansiblelint@v1
with:
fail_on_error: true
molecule:
name: "molecule tests"
runs-on: macos-10.15
needs: lint
strategy:
matrix:
scenario:
- ubuntu
- gentoo
steps:
- uses: actions/checkout@v3
- name: "Setup Python"
uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: syphar/restore-virtualenv@v1
id: cache
- uses: syphar/restore-pip-download-cache@v1
if: steps.cache.outputs.cache-hit != 'true'
- name: "Install dependencies"
if: steps.cache.outputs.cache-hit != 'true'
run: pip3 install --upgrade -r requirements.txt
- name: "Run ${{ matrix.scenario }} scenario"
run: molecule test --scenario-name "${{ matrix.scenario }}"