forked from microsoft/AzureTRE
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (76 loc) · 2.81 KB
/
build_validation_develop.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
---
name: Build Validation
on: # yamllint disable-line rule:truthy
pull_request:
branches: [main]
# for each ref (branch/pr) run just the most recent,
# cancel other pending/running ones
concurrency:
group: "${{ github.workflow }}-${{ github.head_ref }}"
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
# Full git history is needed to get a proper list of
# changed files within `super-linter`
fetch-depth: 0
persist-credentials: false
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
terraform:
# our Terraform uses more than just *.tf files, so need to check changes in the folder
- '**/terraform/**/*'
core:
- 'templates/core/**/*'
core_version:
- 'templates/core/version.txt'
docs:
- 'docs/**/*'
- name: Terraform format check
if: ${{ steps.filter.outputs.terraform == 'true' }}
run: terraform fmt -check -recursive
# find all terraform folders and run validate to catch
# configuration errors
- name: Terraform validation
if: ${{ steps.filter.outputs.terraform == 'true' }}
run: |
find . -type d -name 'terraform' -not -path '*cnab*' -print0 \
| xargs -0 -I{} sh -c 'echo "***** Validating: {} *****"; \
terraform -chdir={} init -backend=false; terraform -chdir={} validate'
- name: "Stale version: core"
if: ${{ steps.filter.outputs.core == 'true' &&
steps.filter.outputs.core_version == 'false' }}
run: echo "::error::Code update without version change" && exit 1
- name: Lint code base
# the slim image is 2GB smaller and we don't use the extra stuff
# Moved this after the Terraform checks above due something similar to this issue:
# https://github.com/github/super-linter/issues/2433
uses: github/super-linter/[email protected]
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_MARKDOWN: true
VALIDATE_PYTHON_FLAKE8: true
VALIDATE_YAML: true
VALIDATE_TERRAFORM_TFLINT: true
VALIDATE_JAVA: true
JAVA_FILE_NAME: checkstyle.xml
VALIDATE_BASH: true
VALIDATE_BASH_EXEC: true
VALIDATE_GITHUB_ACTIONS: true
VALIDATE_DOCKERFILE_HADOLINT: true
VALIDATE_TSX: true
VALIDATE_TYPESCRIPT_ES: true
- name: Docs validation
if: ${{ steps.filter.outputs.docs == 'true' }}
run: |
pip install -r docs/requirements.txt
mkdocs build --strict