-
Notifications
You must be signed in to change notification settings - Fork 4
85 lines (75 loc) · 2.31 KB
/
build.yaml
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
---
name: Build Containers
on:
pull_request:
paths-ignore:
- "**/*.md"
env:
KICS_apt_version_pin: 965a08d7-ef86-4f14-8792-4a3b2098937e
jobs:
kics-scan:
name: KICS Scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: "repo"
- name: KICS Github Action
uses: checkmarx/[email protected]
with:
path: "repo"
output_path: "results"
exclude_queries: ${{ env.KICS_apt_version_pin }}
fail_on: high,medium
enable_comments: true
build:
name: Build
runs-on: ubuntu-latest
needs:
- kics-scan
steps:
- name: Code checkout
uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
build-args: |
RUBY_VERSION=3.1.2
TERRAFORM_VERSIONS=0.14.7 1.5.6
tags: ghcr.io/${{ github.repository }}:rc-${{ github.head_ref }}
test:
name: test
runs-on: ubuntu-latest
needs:
- build
strategy:
matrix:
terraform_version:
- 0.14.7
- 1.5.6
ruby_version:
- 3.1.2
env:
TFENV_TERRAFORM_VERSION: ${{ matrix.terraform_version }}
steps:
- name: Code checkout
uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Test container [kitchen converge]
run: docker run --rm -e TFENV_TERRAFORM_VERSION=${TFENV_TERRAFORM_VERSION} -v "$(pwd)/examples/check-container":/usr/action ghcr.io/${{ github.repository }}:rc-${{ github.head_ref }} "converge"
- name: Test container [kitchen verify]
run: docker run --rm -e TFENV_TERRAFORM_VERSION=${TFENV_TERRAFORM_VERSION} -v "$(pwd)/examples/check-container":/usr/action ghcr.io/${{ github.repository }}:rc-${{ github.head_ref }} "verify"