-
Notifications
You must be signed in to change notification settings - Fork 15
103 lines (91 loc) · 2.82 KB
/
test.yaml
File metadata and controls
103 lines (91 loc) · 2.82 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
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
95
96
97
98
99
100
101
102
103
name: "CI - Test Features & Generate Documentation"
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
features: [
"google-cloud-cli",
"opa",
"conftest",
"tfsec",
"trivy",
"act",
"k9s",
"flyctl",
"aztfy",
"terraformer",
"terraform-docs",
"k6",
"hadolint",
"mizu",
"oras",
"stern",
]
baseImage:
[
"mcr.microsoft.com/devcontainers/base:ubuntu"
]
steps:
- uses: actions/checkout@v3
- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli
- name: "Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'"
run: devcontainer features test -f ${{ matrix.features }} -i ${{ matrix.baseImage }} .
test-global:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli
- name: "Testing global scenarios"
run: devcontainer features test --global-scenarios-only .
update-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: "Update Readme"
uses: devcontainers/action@v1
with:
base-path-to-features: "./src"
generate-docs: "true"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit
id: push_image_info
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
echo "Start."
# Configure git and Push updates
git config --global --add safe.directory /github/workspace
git config --global user.email [email protected]
git config --global user.name github-actions
git config pull.rebase false
git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
message='Automated documentation update'
# Add / update and commit
git add */**/README.md
if [ "$(git status --porcelain | grep "$file" | grep -c -E '([MA]\W).+')" -eq 1 ]; then
echo "::debug Added ${file} to git staging area"
else
echo "::debug No change in ${file} detected"
fi
echo "::debug Following files will be committed"
git status -s
git commit -m 'Automated documentation update [skip ci]' || export NO_UPDATES=true
# Push
if [ "$NO_UPDATES" != "true" ] ; then
git push
fi