-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (38 loc) · 1.44 KB
/
test.yml
File metadata and controls
48 lines (38 loc) · 1.44 KB
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
name: Lint & Test
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
prune-cache: false
- name: Install the project
run: uv sync --locked --all-extras --no-python-downloads
- name: Run Ruff
run: uv run ruff check
- name: Run Ansible-Lint
id: ansible_lint
continue-on-error: true # Allow uploading SARIF report if ansible-lint is not happy
run: uv run ansible-lint --offline --sarif-file ansible-lint.sarif.json # TODO: Reuse just lint
- name: Upload Ansible-Lint SARIF
uses: github/codeql-action/upload-sarif@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2
with:
sarif_file: ansible-lint.sarif.json
category: ansible-lint
- name: Check if ansible_lint step has failed
if: steps.ansible_lint.outcome == 'failure'
run: |
echo "::error title=Ansible-lint::Error during the ansible-lint step"
exit 1