-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (32 loc) · 1.09 KB
/
tf-unittest.yaml
File metadata and controls
36 lines (32 loc) · 1.09 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
name: Terraform Unittest
on:
workflow_call:
inputs:
WORKING_DIRECTORY:
type: string
required: false
default: "."
ENVIRONMENT:
type: string
required: true
jobs:
terraform-unittest:
defaults:
run:
working-directory: ${{ inputs.WORKING_DIRECTORY }}
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v5.0.0
- name: download a build artifact
uses: actions/download-artifact@v6.0.0
id: download
with:
name: artifacts_${{inputs.ENVIRONMENT}}_${{github.sha}}
path: ${{ inputs.WORKING_DIRECTORY }}
- name: rename test file
run: mv ./test_${{inputs.ENVIRONMENT}}_${{github.sha}}.json ./test_${{inputs.ENVIRONMENT}}.json
- name: conftest
uses: docker://openpolicyagent/conftest:v0.62.0@sha256:6182c0c61e83ae6522ed29e5084ac5cce4c88cd0aa26ffb1c6fc57bb34e9daa9
with:
args: test ${{ inputs.WORKING_DIRECTORY }}/test_${{inputs.ENVIRONMENT}}.json --all-namespaces --no-color -p ${{ inputs.WORKING_DIRECTORY }}/policy