94 lines (87 loc) · 2.51 KB
/
lint-unit.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Lint & Unit test
"on":
workflow_call:
inputs:
gems:
required: false
type: string
default: ""
platform:
required: false
type: string
default: "ubuntu-latest"
jobs:
rspec:
# Some RSpec tests require a Windows environment
runs-on: ${{ inputs.platform }}
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install Chef
uses: actionshub/chef-install@2.0.4
- name: Install Gems
run: chef gem install -N "${{ inputs.gems }}"
if: ${{ inputs.gems }}
env:
CHEF_LICENSE: accept-no-persist
- name: Run RSpec
run: chef exec rspec -f j -o tmp/rspec_results.json -f p
env:
CHEF_LICENSE: accept-no-persist
- name: RSpec Report
uses: SonicGarden/rspec-report-action@v2.1.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
json-path: tmp/rspec_results.json
if: always()
cookstyle:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install Chef
uses: actionshub/chef-install@2.0.4
- name: Run Cookstyle
run: chef exec cookstyle --display-cop-names --extra-details
env:
CHEF_LICENSE: accept-no-persist
yamllint:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Run yaml Lint
uses: actionshub/yamllint@main
markdownlint-cli2:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Run Markdown Lint
uses: DavidAnson/markdownlint-cli2-action@v10
with:
globs: "**/*.md"
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gaurav-nelson/github-action-markdown-link-check@1.0.15
with:
use-quiet-mode: "yes"
use-verbose-mode: "yes"
check-modified-files-only: "yes"
base-branch: "main"
check-metadata:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
checks: write # required for the status check
pull-requests: write # required for the PR comment
statuses: write # required for the status check
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check Metadata
uses: damacus/check-chef-metadata-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}